Agency Get Campaign
GET /agency/reportingCampaign?uuid={uuid}
dev url = "https://dev.templatebackend.versal.one/api/v2"
staging url = "https://staging.template.versalence.online/api/v2"
prod url = "https://template.versalence.online/api/v2"
Description
This API allows fetching a report for a specific company, identified by its uuid. The response contains the report data if available. If the company or users are not found, the appropriate error message is returned.
Request Headers
| Header | Type | Description | Constraints | 
|---|---|---|---|
| Authorization | String | JWT token for user authentication and authorization. | Required. Must be in the format Bearer [token]. | 
Request Parameters
| Field | Type | Description | Constraints | 
|---|---|---|---|
| uuid | String | UUID of the company for which the report is to be fetched. | Required. | 
Response Codes
| Status Code | Description | 
|---|---|
| 200 | Success. Report data retrieved successfully. | 
| 403 | Forbidden. Invalid HMAC signature. | 
| 400 | Bad Request. Missing uuidparameter. | 
| 404 | Not Found. No company found with the provided UUID or users not found for the given UUID. | 
| 500 | Internal Server Error. An error occurred while fetching the report. | 
Example Requests
Request (Get Reporting Campaign):
GET /agency/reportingCampaign?uuid=53d1bcd3-aaf0-45e1-9298-5395b6a27b61
Authorization: Bearer your-jwt-token
Response (Report Found - 200):
{
  "success": true,
  "message": "Report retrieved successfully.",
  "data": {
    "reportId": "12345",
    "reportName": "Campaign Analysis",
    "details": "Report details here..."
  }
}
Response (Missing UUID - 400):
{
  "success": false,
  "message": "Bad Request: Missing uuid parameter"
}
Response (No Company Found - 404):
{
  "success": false,
  "message": "No company found with the provided uuid"
}
Response (Users Not Found - 404):
{
  "success": false,
  "message": "Users not found with the provided uuid"
}
Response (Invalid HMAC Signature - 403):
{
  "success": false,
  "message": "Forbidden: Invalid HMAC signature"
}
Response (Internal Server Error - 500):
{
  "success": false,
  "message": "An error occurred while fetching the report.",
  "error": "Error details here"
}
Notes
- Authentication: Ensure the JWT token is valid and authorized to access the reporting campaign data.
- Validation: The uuidparameter is required and should be provided in the request URL.
- Error Handling: If a 500 error occurs, check the error logs for details on what went wrong during the report retrieval process.
