Agency Get Campaign

API URL

https://api.versal.one/<uuid>
GET /agency/reportingCampaign

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 uuid parameter.
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 /53d1bcd3-aaf0-45e1-9298-5395b6a27b61/agency/reportingCampaign
Authorization: Bearer 5395b6a27b61

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


Revision #3
Created 16 January 2025 06:27:13 by Lokesh Ravi
Updated 17 January 2025 07:05:06 by Admin