---
1. Get Company Details
Retrieve details of your company associated with the token:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/me" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
Response:
```json
{
"company": {
"id": 1,
"name": "Your Company",
"logo": "logo.jpeg",
"type": "agency",
"potential_clients": "11-15",
"company_specialty": "paid traffic"
}
}
```
---
2. List Templates
Retrieve all report templates in your company:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/templates" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"' | jq '.data[] | {id, title, used_count}'
```
---
3. List Clients (Projects)
Retrieve all client projects:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/clients" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
4. Get Client Details
Retrieve details of a specific client. Replace with the actual client ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/clients/" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
5. List Client Reports
Get all reports for a specific client. Replace with the actual client ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/clients//reports" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
6. Get Report Details
Retrieve details of a specific report. Replace with the actual report ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/reports/" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
7. List Client Integrations
Get all integrations for a specific client. Replace with the actual client ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/clients//integrations" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
8. Get Integration Details
Retrieve details of a specific integration. Replace with the actual integration ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/integrations/" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
9. Get Integration Widgets
List available widgets for an integration. Replace with the actual integration ID:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/integrations//widgets" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
10. Get Widget Value
Retrieve the value of specific widgets.
Write to /tmp/reportei_request.json:
```json
{
"widgets": ["widget_id_1", "widget_id_2"],
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
```
Then run (replace with the actual integration ID):
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/integrations//widgets/value" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---
11. Create Report (Connector Action)
Create a new report programmatically.
Write to /tmp/reportei_request.json:
```json
{
"client_id": "your-client-id",
"template_id": "your-template-id",
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
```
Then run:
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/create_report" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---
12. Create Dashboard (Connector Action)
Create a new dashboard.
Write to /tmp/reportei_request.json:
```json
{
"client_id": "your-client-id",
"name": "My Dashboard"
}
```
Then run:
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/create_dashboard" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---
13. Add to Timeline (Connector Action)
Add an entry to the client timeline.
Write to /tmp/reportei_request.json:
```json
{
"client_id": "your-client-id",
"title": "Campaign Launched",
"description": "New marketing campaign started"
}
```
Then run:
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/add_to_timeline" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---
14. List Webhook Events
Get available webhook event types:
```bash
bash -c 'curl -s -X GET "https://app.reportei.com/api/v1/webhook/events" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}"'
```
---
15. Subscribe to Webhook
Subscribe to webhook notifications.
Write to /tmp/reportei_request.json:
```json
{
"url": "https://your-webhook-endpoint.com/webhook",
"events": ["report.created", "report.updated"]
}
```
Then run:
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/webhooks/subscribe" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---
16. Unsubscribe from Webhook
Unsubscribe from webhook notifications.
Write to /tmp/reportei_request.json:
```json
{
"webhook_id": "your-webhook-id"
}
```
Then run:
```bash
bash -c 'curl -s -X POST "https://app.reportei.com/api/v1/webhooks/unsubscribe" -H "Authorization: Bearer ${REPORTEI_API_TOKEN}" -H "Content-Type: application/json" -d @/tmp/reportei_request.json'
```
---