The Report Type object
Attributes
-
program_id /integer/
Required
Select the program ID for which you want to retrieve data.
-
currency /string/
Required
Select the currency supported by the chosen program.
-
period_from_to /json/
Required
Select the Start date and End date for retrieving your data.
The format must be entered as follows:
Example: "{"from":"01.01.2023","to":"31.12.2023"}" -
credential_support /boolean/
Required
If your data will be retrieved using credentials, select true, if it will be retrieved using an API key, select false.
If credential_support is selected to be TRUE, the following fields are mandatory.
username /string/
Your encrypted username.
password /string/
Your encrypted password.
-
api_support /boolean/
Required
If your data will be retrieved using an API key, select true, if it will be retrieved using credentials, select false.
If api_support is selected to be TRUE, the following fields are mandatory.
api_key /string/
Your encrypted api key.
api_id /string/
Your encrypted api id.
-
dynamic_variables /boolean/
If the program supports dynamic variables and you want them to be displayed in the report - select true.
If you have selected true, the reporting period must be for one month."
-
report_type /string/
If you want to receive monthly reports, select 'monthly', otherwise choose 'daily'.
-
rev_share_percent /double/
Optional
Used only for affiliate programs using SoftSwiss/Affilka software.
Select the revenue share commissions of the chosen program.
-
cpa_reward_per_ftd /double/
Optional
Used only for affiliate programs using SoftSwiss/Affilka software.
Select the cpa commissions of the chosen program.
THE REQUEST OBJECT
<? php
$program_id= "Integer"
//The starting date and end date for data retrieval
$period_from_to= "Json"
//The currency supported by the selected program
$currency= "String"
//The data retrieved using username/password - select true
$credential_support= "Boolean"
//Encrypted username
$username="String"
//Encrypted password
$password= "String"
//The data retrieved using api key/api id - select true
$api_support= "Boolean"
//Encrypted api key
$api_key= "String"
//Encrypted api id
$api_id= "String"
//Dynamic variables of the program
$dynamic_variables= "Boolean"
//Report type
$report_type = "String"
//Revenue share commissions of the chosen program
$rev_share_percent= "Double"
/Optional/
//Cpa commissions of the chosen program
cpa_reward_per_ftd = "Double"
/Optional/
?>
List All Programs
Returns a list of program data to use to run your report.
-
Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the Report Type object documentation.
You need to authenticate your report queries via your API Token API Token which should be passed in the "Authorization" parameter of the Headers of your request.
-
Returns
The data that returns report:
"program_id" : The program ID that you will need to run the desired report
"program_name" : The name of the program
"software_name" : The software of the program it uses
"category_name" : Program Category
"login_url" : Login URL of the program
"currencies" : The currencies supported by the respective program
When running the report, you must select one of the listed currencies
Example:
In the currency field, you should enter EUR.""credential_support" : Does the respective program support credential support
"api_support" : Does the respective program support API support
"dynamic_variables" : Does the program support dynamic variables
"rev_share_commissions" : Revenue Share Commissions of the program
"cpa_commissions" : Cost Per Action Commission of the program
GET https://yourdomain.com/api-sd/program-list
RESPONSE
{
{
"program_id":"11111",
"program_name":"Program test name",
"soft_name":"Software test name",
"category_name":"(Gambling/Market Place/Financial)",
"login_url":"https://............",
"currencies": [
{
"id":"38",
"name":"USD"
}
{
"id":"17",
"name":"EUR"
}
{
"id":"40",
"name":"N/A"
}
],
"credential_support":"TRUE/FALSE",
"api_support":"TRUE/FALSE",
"dynamic_variables":"TRUE/FALSE",
"rev_share_commissions":"N/A or ..%",
"cpa_commissions":"N/A or ..%",
{.....},
{.....},
]
}
Create a request for execution
Creates a new object and begin running the request.
-
You need to authenticate your report queries via your API Token API Token which should be passed in the "Authorization" parameter of the Headers of your request.
Parameters
-
"period_from_to" : "Period for receiving the report."
"program_id" : "The ID of the program for which you want to receive reports."
"currency" : "You must select a currency that is supported by the program and in which you want your report to be."
"credential_support" : "You must choose whether your program will connect using credentials."
"username" : "If you have selected TRUE for credential_support, you must enter your encrypted username beforehand."
"password" : "If you have selected TRUE for credential_support, you must enter your encrypted password beforehand."
"api_support" : "You need to select whether your program will connect via API support."
"api_key" : "If you have selected TRUE for api_support, you must enter your encrypted api key beforehand."
"api_id" : "If you have selected TRUE for api_support, you must enter your encrypted api id beforehand."
"dynamic_variables" : "If you wish to receive a report based on dynamic variables. "Please note, if you have selected true, the submitted period must be for one month."
"rev_share_percent" : "If the program supports rev share percent and requires it to be included in the report."
"cpa_reward" : "If the program supports cpa reward and requires it to be included in the report."
"report_type" : "If you want to include monthly breakdowns in your report, select 'Monthly', if you want only daily breakdowns, select 'Daily'."
"account_name" : "(optional) Send your custom values in this request parameter and you will get the same values out of the corresponding data responses. You can use this to keep and track the continuity between your data requests and responses."
POST https://yourdomain.com/api-sd/get-program-data
EXAMPLE
{
"period_from_to": "{"from":"01.01.2024","to":"01.09.2024"} /example/"
"program_id": "11111 /example/"
"currency": "EUR /example/"
"credential_support": "TRUE/FALSE"
"username": "*******"
"password": "*******"
"api_support": "TRUE/FALSE"
"api_key": "*******"
"api_id": "*******"
"dynamic_variables": "TRUE/FALSE"
"rev_share_percent": ""
"cpa_reward": ""
"report_type": "Monthly/Daily"
}
RESPONSE
"success":"True"
"msg":"Your request for data scraping for the "Test" program has been accepted."
"id": "*****"
}
Retrieve data
-
Every round hour the server will execute a command that will send the collected data for the requests that you've made to the webhook.
Returns the specified request object if found or throws an error otherwise.
-
If you are using MySQL, your data types must be:
- "program_id" : "Integer"
- "request_id" : "Integer"
- "program_name" : "String"
- "software_name" : "String"
- "json_data" : "JSON" /The data can be stored up to 4 GB for each record./
- "created_at" : "DATE"
POST YOUR WEBHOOK
RESPONSE
{
"request_id":"*****"
"program_name": "Program_test"
"software_name": "Software_test"
"json_data":{
"balance":"0.00",
"daily_report":{
"Brand name":{
"Campaign name":{
"2024-01-01":{
"Date": "Y-m-d"
"Last_sync": "Y-m-d H:i:s"
"Impressions": "0"
"Clicks": "0"
"Signups": "0"
"Installs": "0"
"First_time_deposits": "0"
"Revenue_share_commissions": "0"
"Cap_commissions": "0"
"Qualified_first_time_deposit": "0"
"Total_commissions": "0"
"Channel": "Brand name"
"Campaign": "Campaign name"
"2024-01-02":{.....}
"2024-01-03":{.....}
"2024-01-04":{.....}
{....................}
}
}
}
"report_month": {
"2024-01":{
"Date": "Y-m-d"
"Last_sync": "Y-m-d H:i:s"
"......."
"Channel": "Brand name"
"Campaign": "Campaign name"
"Total_commissions": 0
}
"2024-02":{.....}
}
"dynamic_report":{
"Date": "Y-m-d"
"Last_sync": "Y-m-d H:i:s"
"Campaign": "Campaign name"
"Channel": "Brand name"
"Total_commissions": "0"
"var1": "Dynamic variables"
"var2": "Dynamic variables"
"Impressions": "0"
"Clicks": "0"
"Signups": "0"
"Installs": "0"
"First_time_deposits": "0"
"Revenue_share_commissions": "0"
"Cap_commissions": "0"
"Qualified_first_time_deposit": "0"
}
"created_at":: "2024-01-01"
}
Errors in Retrieve a Request
-
Errors Returned
If the report cannot be retrieved, returns the following errors.
-
Status Code - "4xx/500"
-
Type object - "Json"
-
Errors
- "msg" : "Wrong credentials!"
- "msg" : "Report processing failed. Please check if the affiliate program website is accessible."
- "msg" : "CloudFlare Detected!"
- "msg" : "Internal server error."
POST YOUR WEBHOOK
RESPONSE
{
"msg": "Wrong credentials!"}