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 asusername, email, griddid (unique GNET ID), or phone. This ensures data integrity by preventing duplicate records during registration.
Endpoint
GET /api/user/check
Query Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| username | string | Username to search for existing users | No |
| string | Email address to check for existing users | No | |
| phone | string | Phone number to search for existing users | No |
Example Request
Request URL:
Response
The response will indicate whether each queried identifier was found, along with any related data.Example Response
Success Response
| Status | Description |
|---|---|
| 200 | Request processed successfully, returns results |
Response Fields
| Field | Type | Description |
|---|---|---|
| success | boolean | Indicates if the operation was successful |
| username | object | Result of username search, if provided |
| object | Result of email search, if provided | |
| griddid | object | Result of GNET ID search, if provided |
| phone | object | Result of phone number search, if provided |
Error Responses
| Status | Description | Possible Causes |
|---|---|---|
| 400 | Bad request | Invalid or missing query parameters |
| 500 | Internal server error | Server-side error during data processing |
Example Error Response
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.