External Accounts

External accounts are links to app stores from which sales and other data is imported. The /external_accounts resource provides complete control and allows retrieving, updating, adding, and deleting external_accounts. appFigures currently supports iTunes Connect, Android Market, and Google Checkout API. More app stores will be supported in the future.

Listing existing accounts

Request

GET /external_accounts

Example Response

// GET /external_accounts
 
{
  "50956": {
    "id": 50956,
    "account_id": 100101,
    "nickname": "Main iTunes",
    "username": "johnny@me.com",
    "auto_import": true,
    "has_iads": false,
    "type_id": 0,
    "type": "itunes_connect"
  },
  "31174": {
    "id": 31174,
    "account_id": 100101,
    "nickname": "Android apps",
    "username": "coolapps@gmail.com",
    "auto_import": true,
    "has_iads": false,
    "type_id": 1,
    "type": "android_market"
  },
  ...
}

Looking up one account

Request

GET /external_accounts/{external_account_id}

Example Response

// GET /external_accounts/31174
  {
    "id": 31174,
    "account_id": 100101,
    "nickname": "Android apps",
    "username": "coolapps@gmail.com",
    "auto_import": true,
    "has_iads": false,
    "type_id": 1,
    "type": "android_market"
  }

Creating a new external account

Request

POST /external_accounts/

Arguments (as json in request body)

accountId
The Id of the account to update
nickname
A friendly name for this account
username
The username to the app store’s account
password
The password to the app store account
auto_import
true or false to import report for this account automatically
type
The type of account being linked. Possible options: itunes_connect, android_market, google_checkout. More types will be available in the future

Example Request

// POST /external_accounts/31174
{
  "nickname": "A new account",
  "username": "myusername",
  "password": "p455w0rd!"
  "auto_import": true,
  "type": "itunes_connect"
}

Example Response

// POST /external_accounts/31174
  {
    "id": 31175,
    "account_id": 100101,
    "nickname": "A new account",
    "username": "myusername",
    "auto_import": true,
    "has_iads": false,
    "type_id": 0,
    "type": "itunes_connect"
  }

Updating an external account

Request

PUT /external_accounts/{accountId}

Arguments (as json in request body)

accountId
The Id of the account to update
nickname
A friendly name for this account
username
The username to the app store’s account
password
The password to the app store account
auto_import
true or false to import report for this account automatically

Example Request

  // GET /external_accounts/31175
  {
    "id": 31175,
    "nickname": "Games Account",
    "username": "awesomegames@me.com",
    "password": "ipl4yallth3time",
    "auto_import": true,
    "type": "itunes_connect"
  }
  // PUT /external_accounts/31175
  {
    "nickname": "A new Nickname(Games Account)",
    "username": "awesomegames+edited@me.com",
    "password": "ipl4yallth3timexx",
    "auto_import": false,
    "type": "itunes_connect"
  }

Example Response

  // PUT /external_accounts/31175
  {
    "id": 31175,
    "nickname": "A new Nickname(Games Account)",
    "username": "awesomegames+edited@me.com",
    "password": "ipl4yallth3timexx",
    "auto_import": false,
    "type": "itunes_connect"
  }

Deleting an external account

Request

DELETE /external_account/{accountId}

Arguments

accountId
The ID of the external account to delete

Example Response

// DELETE /external_accounts/90438
// HTTP 204

Note: Deleting an external account will not remove products or data related to it.