Skip to main content

User Check API

The User Check API allows you to verify if a user or company already exists in the GNet Connect system using identifiers such as username, email, griddid (unique GNET ID), or phone. This ensures data integrity by preventing duplicate records during registration.

Endpoint

GET /api/user/check

Query Parameters

ParameterTypeDescriptionRequired
usernamestringUsername to search for existing usersNo
emailstringEmail address to check for existing usersNo
phonestringPhone number to search for existing usersNo
You can pass one or multiple query parameters in the same request. If multiple parameters are provided, the API will search and return results for each.

Example Request

Request URL:

GET /api/checkUser?email=user@example.com&phone=+1234567890

Response

The response will indicate whether each queried identifier was found, along with any related data.

Example Response

{
  "success": true,
  "username": {
    "query": "user123",
    "found": true,
    "result": {
      "id": "12345",
      "email": "user123@example.com",
      "name": "John Doe"
    }
  },
  "email": {
    "query": "user@example.com",
    "found": true,
    "result": {
      "id": "56789",
      "name": "Jane Smith"
    }
  },
  "griddid": {
    "query": "company-slug",
    "found": false,
    "result": null
  },
  "phone": {
    "query": "+1234567890",
    "found": true,
    "result": {
      "company": "ABC Corp",
      "contact": "Main Contact"
    }
  }
}

Success Response

StatusDescription
200Request processed successfully, returns results

Response Fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
usernameobjectResult of username search, if provided
emailobjectResult of email search, if provided
griddidobjectResult of GNET ID search, if provided
phoneobjectResult of phone number search, if provided

Error Responses

StatusDescriptionPossible Causes
400Bad requestInvalid or missing query parameters
500Internal server errorServer-side error during data processing

Example Error Response

{
  "success": false,
  "status": 500,
  "error": "Internal server error"
}

Best Practices

  • Before registering new users, always call this API to check for duplicates based on key identifiers.
  • Use multiple parameters when possible to reduce false positives (e.g., searching by both email and phone).
  • Handle 400 and 500 status codes gracefully to ensure a smooth user experience.
Ready to integrate this? Check out the Signup API to learn how to register new users or companies once validation is complete.
I