Skip to main content

Agency Sync

POST /agency/sync

Description

This API synchronizes agency data using a unique identifier (uuid). The client must provide an authorization token to access this endpoint. The API responds with success, error, or status messages based on the input and server-side processes.


Request Headers

Header Type Description Constraints
Authorization String Bearer token for authentication and authorization. Required. Must be in the format Bearer [token].

Query Parameters

Parameter Type Description Constraints
uuid String Unique identifier for the agency. Required. Must be a valid UUID format.

Response Codes

Status Code Description
200 Sync completed successfully. Returns a success message.
400 Bad request. The uuid parameter is missing or invalid.
403 Access forbidden. Invalid HMAC signature.
404 No agency found with the provided uuid.
500 Internal server error. Something went wrong on the backend.

Example Requests

Request (Sync Agency):

 POST /agency/sync?uuid=53d1bcd3-aaf0-45e1-9298-5395b6a27b61 Authorization: Bearer 904ea66961ace9ab800acfd6c92664587d2cdeccec41bed9dc83d69e52a9126d 

Response (Sync Complete - 200):

 { "status": true, "message": "Sync Complete" }  

Response (Missing UUID - 400):

 { "success": false, "message": "Bad Request: Missing uuid parameter" }  

Response (Invalid HMAC - 403):

 { "success": false, "message": "Forbidden: Invalid HMAC signature" }  

Response (Not Found - 404):

 { "success": false, "message": "No company found with the provided uuid" }  

Response (Server Error - 500):

 { "status": false, "message": "Something went wrong on the backend" }  

Notes

  • Authentication: The authorization token must be valid. If it is missing or invalid, the request will fail.
  • Field Validation: Ensure the uuid parameter is correctly formatted as a valid UUID.
  • Error Handling: For 500 errors, consult server logs for debugging.