Any requests from our api can be directed to any of our country instances, subdomain - api.it24.io
Login via api:
curl https://es.it24.io/api/v1/login/ -d "[email protected]&password=xxxxxx"
Then you get the response and use authToken and userId in each header for authentication request by api
{
"status": "success",
"data": {
"authToken": "9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6",
"userId": "sDT2QaBnBdTu7Hi5G"
}
}
Client Profile. Get Data: "fullName", "email", "phone", "status", "companyName", "country", "postalCode", "province", "city", "address", "certified":
curl -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G"
https://us.it24.io/api/v1/client_profile
Or
curl -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G"
https://us.it24.io/api/v1/client_profile/sDT2QaBnBdTu7Hi5G
Edit client profile "fullName", "email", "phone", "country", "postalCode", "province", "city", "address"
curl -X POST -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G"
https://us.it24.io/api/v1/client_profile/sDT2QaBnBdTu7Hi5G -d "companyName=test2 company"
Service request. Get all requests (the same fields as for certain request)
curl -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G"
https://us.it24.io/api/v1/service_request
Get one certain request by id "id_Handyman", "handyman_profile", "destinationAddress", "destinationPoint", "id_Service", "id_ServiceName", "dateServicing", "comment", "status", "stampStatus", "historyStatus", "changed", "instance"
curl -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G"
https://es.it24.io/api/v1/service_request/6EFNecP9nAQnSRja6
Create new request "id_Client", "id_Handyman", "destinationAddress", "destinationPoint", "id_Service", "dateServicing", "comment", "instance"
curl -X POST -H "X-Auth-Token: 9f0e25bsiSV-p0gBOb3gVwFljwZX0eYJoaDKT3SIIq6" -H "X-User-Id: sDT2QaBnBdTu7Hi5G" https://es.it24.io/api/v1/service_request -d "id_Handyman=WY2zMDAF8oiZNksXg" -d "destinationAddress=test address" -d "destinationPoint[lat]=42.24" -d "destinationPoint[lng]=27.45" -d "id_Service=dpXfwCQT2BFL6NDFw" -d "dateServicing=1474624800" -d "comment=test api" -d "instance=es"
Examples of response. For success response
{
"status": "success",
"data": {
"_id": "dSjRkRfN3RGQC8sZN",
"email": "[email protected]",
"fullName": "kv",
"phone": "+1 123123123123",
"certified": true
}
}
For error response
{
"status": "error",
"message": "You do not have permission to do this."
}
For failed response
{
"status": "fail",
"message": "You are allowed to get a data only from your profile."
}