Skip to main content

Response format and the account information block

Written by Dariy

The envelope


Every successful response has the same four top-level keys:

{   "success": true,
"data": { },
"dataRow": 128,
"row_count": 131
}

Key

Type

Meaning

success

boolean

true when the report was produced

data

object or array

The report itself — shape depends on groupBy, see below

dataRow

integer

Legacy row counter, kept for compatibility

row_count

integer

Number of statistics rows in this response. Use this one.

A failed request returns success: false plus a message or an error — see Article 7.

Three shapes of data

Accounts and Dynamic Variables — an object keyed by account name:

data → "<account name>" → { info, stats }

Brands and Campaigns — an object keyed by brand or campaign name, then by account name:

data → "<brand or campaign>" → "<account name>" → { info, stats }

Brands and campaigns the affiliate program did not name are collected under "N/A".

Players, Geo and Postbacks — an array of accounts, sorted by account name:

data → [ { account_id, account_name, info, stats } ]

These three name the account at the top of each entry rather than inside info, because their stats is a flat list of rows with nothing else in it to say which account a row belongs to. The other four reports carry the same two values inside info. Either way each appears exactly once.

Accounts with no data are included

An account that produced no rows for the period is still in the response, with its full info block and empty stats ({} or []). This is deliberate: an account that is frozen, closed, or failing to sync is exactly the one that produces no rows, and leaving it out would make its absence read like "nothing to report".

Check info.status and info.error to tell "no activity" from "not working".

The info block

Identical in every report — same fields, same types, same conventions:

Field

Type

Notes

program_name

string

The affiliate program. "N/A" if the program is unknown, deleted, or the account is a CSV upload never attached to one

program_id

integer or null

null when the account is not attached to a program

software

string

Affiliate software behind the program. "N/A" on the same misses

currency

string

ISO 4217 code the figures in this entry are actually in

balance

number or null

Account balance as last read from the affiliate program. Always null on the Postbacks report, which never sees a balance

tags

array of strings

Your account tags. [] when there are none

status

string or null

See the table below

error

string or null

null when nothing is wrong; otherwise a readable explanation

last_sync

string or null

When this account last synced. null if it never has

account_id

integer or null

StatsDrone's id for the affiliate account — stable, safe to key on

account_name

string

The name you gave the account in StatsDrone

On the Players, Geo and Postbacks reports, account_id and account_name sit at the top of the entry instead of inside info; the other nine fields are unchanged.

info.status values:

Value

Meaning

sync_success

The last sync completed

sync_failed

The last sync did not complete — error says what happened

access_denied

The affiliate program refused the credentials

frozen_report

You have excluded this account from syncing

closed_program

The affiliate program is closed or no longer supported

csv_report

Data comes from CSV uploads, so it never syncs

last_sync is a date-and-time string, YYYY-MM-DD HH:MM:SS. Some accounts return a date only, YYYY-MM-DD, depending on how they were last synced — parse it leniently.

Types you can rely on

  • Counters (raw_clicks, signups, deposits_count, …) are JSON numbers, never strings.

  • Monetary fields are JSON numbers. The one exception is flat_fee, which can come back as a numeric string such as "0.00" on some responses — always parse it as a number rather than comparing it to 0.

  • tags is always a real JSON array of strings — [] when empty. It is not a string containing JSON, and never the text "null".

  • Missing values are null, never the string "null" and never 0. A null means "not reported"; a 0 means a genuine zero.

  • Idsaccount_id and program_id are integers.

  • Object keys are free text. Account, brand and campaign names come from you and from the affiliate programs, so they can contain anything — including quotes, brackets and non-Latin characters. Read them as opaque strings; do not try to split them apart.

  • Fields may be missing entirely if the API key belongs to a team member whose seat hides certain report metrics. Treat a missing key as "not available to this key" rather than zero.

Did this answer your question?