This document provides instructions for using the following Opta APIs:
Revenue API
Lead Lookup API
Ping Lookup API
Campaign Status API
Suppression List API
You can create access tokens in the API section of your Opta login and grant API access to your advertising and publishing partners.
Revenue API Endpoint
This endpoint allows you to fetch revenue from specific traffic sources or by a lead's email.
GET https://app.opta.io/c_api/p_rev
Query Parameters
Parameter | Description | Example |
| Company ID |
|
| Start date ( |
|
| End date ( |
|
| Publisher ID |
|
| Report by "source" or "lead" |
|
Header Parameters
Header | Description |
| Your username |
| Your access token |
Request Example
curl --location --request GET 'https://app.opta.io/c_api/p_rev?CompID=123&DateFrom=2024-10-01&DateTo=2024-10-30&PublisherID=456&ReportBy=source' \
--header 'username: your_username' \
--header 'accesstoken: your_access_token'
Response Example
[
{
"dateRange": "10/01/2024 - 10/30/2024",
"affId": "affiliate_id",
"subId": "sub_id",
"pubPayout": 1000.0
},
{
"dateRange": "10/01/2024 - 10/30/2024",
"affId": "affiliate_id",
"subId": "sub_id",
"pubPayout": 1500.0
}
]
Lead Lookup API Endpoint
This endpoint allows you to fetch all lead data for a campaign. Include the data points you want to fetch and the number of leads.
GET https://app.opta.io/c_api/lead_data
Query Parameters
Parameter | Description | Example |
| Company ID |
|
| Campaign ID |
|
| Start date ( |
|
| End date ( |
|
|
|
|
|
|
|
| Data points to include (e.g., |
|
|
|
|
| Publisher ID |
|
| Phone number to search for |
|
| Email address to search for |
Header Parameters
Header | Description |
| Your username |
| Your access token |
Request Example
curl --location --request GET 'https://app.opta.io/c_api/lead_data?CompID=123&CampaignID=456&DateFrom=2024-10-01&DateTo=2024-10-30&LeadStatus=all&IncludeTestLeads=false&DataPoints=Em,fn,ln&RecordCount=10&PublisherID=789&PhoneNumber=5551234567&[email protected]' \
--header 'username: your_username' \
--header 'accesstoken: your_access_token'
Response Example
[
{
"DateTime": "2024-10-15T10:00:00Z",
"Source": "source_name",
"AffID": "affiliate_id",
"SubID": "sub_id",
"LeadStatus": "accepted",
"PostToOpta": "Yes",
"PostToClient": "Yes",
"PostedData": "Data sent",
"ResponseText": "Success",
"ResponseStatus": "200",
"TestLead": "false",
"LeadID": "lead_id",
"PreCheckToken": "token_value",
"LeadType": "Type A",
"Email": "[email protected]",
"First Name": "John",
"Last Name": "Doe",
"Address": "123 Main St",
"City": "Anytown",
"State": "CA",
"Zip": "12345",
"Gender": "M",
"Marital Status": "Single",
"Phone": "555-123-4567",
"Date Of Birth": "1990-01-01",
"Are you home owner": "Yes",
"IP Address": "192.168.1.1",
"User Agent": "Mozilla/5.0",
"User Platform": "Windows"
}
]
Ping Lookup API Endpoint
This endpoints allows you to fetch pre-ping data for a specific campaign. Enter the data points you'd like to fetch and the number of records.
GET https://app.opta.io/c_api/ping_data
Query Parameters
Parameter | Description | Example |
| Company ID |
|
| Campaign ID |
|
| Start date ( |
|
| End date ( |
|
|
|
|
| Data points to include (e.g., |
|
|
|
|
| Publisher ID |
|
| Phone number to search for |
|
| Email address to search for |
Header Parameters
Header | Description |
| Your username |
| Your access token |
Request Example
curl --location --request GET 'https://app.opta.io/c_api/ping_data?CompID=123&CampaignID=456&DateFrom=2024-10-01&DateTo=2024-10-30&PublisherID=789&IncludeTestLeads=false&RecordCount=10&PhoneNumber=5551234567&[email protected]' \
--header 'username: your_username' \
--header 'accesstoken: your_access_token'
Response Example
[
{
"RecordID": "record_id",
"LogDateTime": "2024-10-15T10:00:00Z",
"CampaignID": "456",
"CampaignName": "Campaign Name",
"PublisherID": "789",
"PublisherName": "Publisher Name",
"RequestDatetime": "2024-10-15T10:00:00Z",
"RequestURL": "https://example.com/ping",
"RequestHeader": "Headers info",
"RequestData": "Data sent",
"ResponseStatus": "200",
"ResponseData": "Success",
"ResponseCode": "OK",
"StartDatetime": "2024-10-15T10:00:00Z",
"EndDatetime": "2024-10-15T10:00:01Z",
"Duration": "1s",
"PingToken": "token_value",
"PingStatus": "Success",
"PingMessage": "Ping accepted",
"TestLead": "false"
}
]
Campaign Status API Endpoint
This endpoint allows you to activate or pause campaigns with an API call.
POST https://app.opta.io/c_api/campaign
Query Parameters
Parameter | Description | Example |
| Company ID |
|
| Campaign ID |
|
|
|
|
Header Parameters
Header | Description |
| Your username |
| Your access token |
Request Example
curl --location --request POST 'https://app.opta.io/c_api/campaign?CompID=123&CampaignID=456&Status=active' \
--header 'username: your_username' \
--header 'accesstoken: your_access_token' \
--data ''
Response Example
{
"message": "Campaign status updated successfully"
}
Suppression List API Endpoint
This endpoint allows you to add a lead to a campaign or global suppression list. Include a campaign ID to add it to a specific campaign. Leave campaign ID blank to add it to your account's global suppression list (block across all campaigns).
POST https://app.opta.io/c_api/suppression
Query Parameters
Parameter | Description | Example |
| Company ID |
|
| Campaign ID |
|
| Clear Text or MD5 |
|
Header Parameters
Header | Description |
| Your username |
| Your access token |
Body
Note: Each data node can accept more than one item separated by a comma.
Parameter | Description | Example |
|
|
|
Request Example
curl --location --request POST 'https://app.opta.io/c_api/suppression?CompID=123&Format=Clear&CampaignID=456' \
--header 'username: your_username' \
--header 'accesstoken: your_access_token' \
--header 'Content-Type: application/json' \
--data '{
"email":"",
"phone":"",
"ip":""
}'
Response Example
{
"message": "Successfully suppressed data"
}
Note: You can create access tokens in the API section of your Opta login. You can also provide your advertising and publishing partners with API access.