Skip to main content
All CollectionsOpta Integrations
Opta API Documentation
Opta API Documentation

This article explains our API capabilities and how you can use them to fetch data from Opta.

Cole Bridge avatar
Written by Cole Bridge
Updated over a week ago

This document provides instructions for using the following Opta APIs:

  1. Revenue API

  2. Lead Lookup API

  3. Ping Lookup API

  4. Campaign Status API

  5. 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

CompID

Company ID

123

DateFrom

Start date (yyyy-mm-dd)

2024-10-01

DateTo

End date (yyyy-mm-dd)

2024-10-30

PublisherID

Publisher ID

456

ReportBy

Report by "source" or "lead"

source

Header Parameters

Header

Description

username

Your username

accesstoken

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

CompID

Company ID

123

CampaignID

Campaign ID

456

DateFrom

Start date (yyyy-mm-dd)

2024-10-01

DateTo

End date (yyyy-mm-dd)

2024-10-30

LeadStatus

all, accepted, or rejected

all

IncludeTestLeads

true or false

false

DataPoints

Data points to include (e.g., Em,fn,ln)

Em,fn,ln

RecordCount

all, 10, 25, or 50

10

PublisherID

Publisher ID

789

PhoneNumber

Phone number to search for

5551234567

EmailAddress

Email address to search for

Header Parameters

Header

Description

username

Your username

accesstoken

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

CompID

Company ID

123

CampaignID

Campaign ID

456

DateFrom

Start date (yyyy-mm-dd)

2024-10-01

DateTo

End date (yyyy-mm-dd)

2024-10-30

IncludeTestLeads

true or false

false

DataPoints

Data points to include (e.g., em,fn,ln)

em,fn,ln

RecordCount

all, 10, 25, or 50

10

PublisherID

Publisher ID

789

PhoneNumber

Phone number to search for

5551234567

EmailAddress

Email address to search for

Header Parameters

Header

Description

username

Your username

accesstoken

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

CompID

Company ID

123

CampaignID

Campaign ID

456

Status

active or inactive

active

Header Parameters

Header

Description

username

Your username

accesstoken

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

CompID

Company ID

123

CampaignID

Campaign ID

456

Format

Clear Text or MD5

Clear or MD5

Header Parameters

Header

Description

username

Your username

accesstoken

Your access token

Body

Note: Each data node can accept more than one item separated by a comma.

Parameter

Description

Example

Data

email, phone, ip

[email protected], 1234567890, 192.0.24.146 or 2002:db8::8a3f:362:789

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.

Did this answer your question?