Documentation for EmAuth REST API
Overview
The EmAuth REST API enables user authentication and retrieval of user data via secure HTTP endpoints. These endpoints can be accessed from any platform or programming language capable of making HTTP requests.
Endpoints
1. Verify User
Description
This endpoint verifies whether a user has authenticated themselves for a given application.
HTTP Method
POST
Endpoint
https://emauth.mukham.in/sdk/verifyUser
Form Parameters
| Parameter | Type | Description |
|---|---|---|
email_of_user |
String | The email address of the user. |
requester |
String | The name of the requesting application. |
Response
true: The user successfully authenticates.false: The user fails to authenticate.
Example Request
curl -X POST https://emauth.mukham.in/sdk/verifyUser \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "email_of_user=demo@example.com" \
-d "requester=Demo App"
2. Get User Data
Description
This endpoint retrieves specific user data requested by the application.
HTTP Method
POST
Endpoint
https://emauth.mukham.in/sdk/getUserData
Form Parameters
| Parameter | Type | Description |
|---|---|---|
email_of_user |
String | The email address of the user. |
requested_data |
String | A comma-separated list of requested data. Possible values: Name, Date-Of-Birth, Image, IP. |
requester |
String | The name of the requesting application. |
Response
A JSON string containing the requested data. The Image field, if requested, is represented in Base64 format.
Example Request
curl -X POST https://emauth.mukham.in/sdk/getUserData \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "email_of_user=demo@example.com" \
-d "requested_data=Name,IP" \
-d "requester=Demo App"
Response Examples
Verify User Response
- Successful Authentication:
json true - Failed Authentication:
json false
Get User Data Response
{
"Name": "John Doe",
"IP": "192.168.1.1"
}
For an image request:
{
"Image": "data:image/png;base64,iVBORw0KGgoAAAANS..."
}
Notes
- Always use HTTPS to ensure secure communication with the API.
- Handle Base64-encoded image data properly before use.
- Ensure your application has permission to access user data and complies with relevant data protection laws.
Error Handling
In case of an error, the API will return an appropriate HTTP status code and error message in the response.
Example Error Response
{
"error": "Invalid email_of_user parameter"
}