# 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**

<table id="bkmrk-header-type-descript"><thead><tr><th>Header</th><th>Type</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td>`Authorization`</td><td>String</td><td>JWT token for user authentication and authorization.</td><td>Required. Must be in the format `Bearer [token]`.</td></tr></tbody></table>

---

#### **Request Parameters**

<table id="bkmrk-field-type-descripti"><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Constraints</th></tr></thead><tbody><tr><td>`uuid`</td><td>String</td><td>UUID of the company for which the report is to be fetched.</td><td>Required.</td></tr></tbody></table>

---

#### **Response Codes**

<table id="bkmrk-status-code-descript"><thead><tr><th>Status Code</th><th>Description</th></tr></thead><tbody><tr><td>`200`</td><td>Success. Report data retrieved successfully.</td></tr><tr><td>`403`</td><td>Forbidden. Invalid HMAC signature.</td></tr><tr><td>`400`</td><td>Bad Request. Missing `uuid` parameter.</td></tr><tr><td>`404`</td><td>Not Found. No company found with the provided UUID or users not found for the given UUID.</td></tr><tr><td>`500`</td><td>Internal Server Error. An error occurred while fetching the report.</td></tr></tbody></table>

---

#### **Example Requests**

**Request (Get Reporting Campaign):**

```json

GET /53d1bcd3-aaf0-45e1-9298-5395b6a27b61/agency/reportingCampaign
Authorization: Bearer 5395b6a27b61

```

**Response (Report Found - 200):**

```json

{
  "success": true,
  "message": "Report retrieved successfully.",
  "data": {
    "reportId": "12345",
    "reportName": "Campaign Analysis",
    "details": "Report details here..."
  }
}

```


**Response (Missing UUID - 400):**

```json

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

```


**Response (No Company Found - 404):**

```json

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

```


**Response (Users Not Found - 404):**

```json

{
  "success": false,
  "message": "Users not found with the provided uuid"
}

```


**Response (Invalid HMAC Signature - 403):**

```json

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

```


**Response (Internal Server Error - 500):**

```json

{
  "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 `uuid` parameter 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.