# Agency Read Campaign API URI ``` https://api.versal.one/ ``` ``` GET /agency/getCampaignData ``` #### **Description** This API retrieves campaign data for a specified agency using a unique identifier (`uuid`). It supports pagination for large datasets. A valid JWT token is mandatory for authentication and authorization. --- #### **Request Headers**
HeaderTypeDescriptionConstraints
`Authorization`StringJWT token for authentication and authorization.Required. Must be in the format `Bearer [token]`.
--- #### **Query Parameters**
FieldTypeDescriptionConstraints
`uuid`StringUnique identifier for the agency.Required.
`page`IntegerPage number for pagination.Optional. Defaults to 1.
`limit`IntegerNumber of items per page.Optional. Defaults to 10.
--- #### **Response Codes**
Status CodeDescription
`200`Success. Campaigns retrieved successfully.
`400`Invalid pagination parameters or missing `uuid` parameter.
`403`Forbidden: Invalid HMAC signature.
`404`No campaigns found for the provided `uuid` or no company associated with the `uuid`.
`500`An unexpected error occurred while fetching the campaigns.
--- #### **Example Requests** **Request:** ```json GET 53d1bcd3-aaf0-45e1-9298-5395b6a27b61/agency/getCampaignData?page=1&limit=10 Authorization: Bearer 5395b6a27b61 ``` **Response (200 - Success):** ```json { "success": true, "message": "Campaigns retrieved successfully.", "data": [ // List of campaigns ], "pagination": { "total": 100, "page": 1, "limit": 10, "totalPages": 10 } } ``` **Response (400 - Invalid Parameters):** ```json { "success": false, "message": "Invalid pagination parameters." } ``` **Response (403 - Forbidden):** ```json { "success": false, "message": "Forbidden: Invalid HMAC signature." } ``` **Response (404 - No Campaigns Found):** ```json { "success": false, "message": "No campaigns found for the given UUID." } ``` **Response (500 - Internal Server Error):** ```json { "success": false, "message": "An unexpected error occurred while fetching the campaigns.", "error": "Error details here" } ``` --- #### **Notes** - **Authentication:** Ensure the JWT token is valid. Invalid or missing tokens will result in a 403 or 401 error. - **Field Validation:** The `uuid` field is mandatory for this request. - **Error Handling:** Review server logs for debugging 500 errors. - **Pagination:** If the `page` or `limit` is invalid, a 400 error is returned.