Endpoint and Authentication

Please refer to the API overview section to get the API endpoint, query format and authentication process.

This section of the documentation shows how to list, create and manage your automated data exporters, as well as get info about the daily exports executed.

Automated Data Exporters

List

GET /api/data_exporters

This endpoint lists all the exporters for the current user making the request.

Response

Status: 200 OK

{
  "success": true,
  "result": [
    {
      "identifier": "FAAUTOXPRT_12345abcde",
      "name": "Test exporter 1",
      "type": "aws_secret_key",
      "active": true,
      "apps": [
        {
          "name": "Test app",
          "identifier": "FAAPPLI_123456789",
          "package_name": "test.package.name",
          "platform": "iOS App"
        }
      ],
      "subfolder": "",
      "bucket_name": "test-bucket",
      "exported_data": [
        "sessions",
        "logs",
        "details"
      ],
      "initial_run_at": "2020-01-10T03:00:00Z",
      "last_run_at": "2020-04-14T11:58:59Z"
    },
    {
      "identifier": "FAAUTOXPRT_67890zyxwu",
      "name": "Test exporter 2",
      "type": "aws_account_id",
      "active": false,
      "apps": [
        {
          "name": "Test app 2",
          "identifier": "FAAPPLI_qwertyuiop",
          "package_name": "test.package.name2",
          "platform": "Android App"
        }
      ],
      "subfolder": "",
      "bucket_name": "test-bucket-2",
      "exported_data": [
        "attributes",
        "campaign_results_per_user",
        "crashes"
      ],
      "initial_run_at": "2020-02-23T01:59:10Z",
      "last_run_at": "2020-03-28T14:30:22Z"
    }
  ]
}

View

GET /api/data_exporters/identifier

Returns a specific automated data exporter configuration.

Query Parameters

Property Type Description Default
identifier string The identifier of the data exporter to view required

Response

Status: 200 OK

{
  "success": true,
  "result": {
    "identifier": "FAAUTOXPRT_E9VBvJH71yA",
    "name": "Test Exporter",
    "type": "aws_secret_key",
    "active": true,
    "apps": [
      {
        "name": "Test App",
        "identifier": "FAAPPLI_abcdefghi",
        "package_name": "test.package.name",
        "platform": "iOS App"
      }
    ],
    "subfolder": "",
    "exported_data": [
      "sessions",
      "logs"
    ],
    "initial_run_at": "2020-04-14T11:58:59Z",
    "last_run_at": "2020-04-14T11:58:59Z",
    "bucket_name": "test-bucket",
    "aws_region": "eu-west-1",
    "exports": {
      "1588636800": [
        {
          "identifier": "FADATAEXP_ocnbnScNtoI",
          "date": "2020-04-14T09:10:09Z",
          "type": "sessions",
          "total_files": 2,
          "total_exported": 2
        },
        {
          "identifier": "FADATAEXP_6M_nHN0JC00",
          "date": "2020-04-20T09:10:29Z",
          "type": "logs",
          "total_files": 3,
          "total_exported": 3
        }
      ]
    },
    "aws_access_key_id": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "aws_secret_access_key": "1234567890987654321abcdef"
  }
}

Status: 404 Not Found

{
  "status": "not_found",
  "success": false,
  "error_message": "Automated data exporter not found"
}

Create

POST /api/data_exporters

Creates a new automated exporter for the user's current entity.

Body Parameters

Property Type Description Default
name string A name for your exporter -
export_configuration string The type of the exporter, either aws_account_id (using an AWS account ID), aws_secret_key (using a pair of AWS access and secret keys) required
bucket_name string The name of the S3 bucket to export data to required
subfolder string The name of a sub folder inside the S3 bucket -
aws_region string The region where the S3 bucket is located eu-west-1
aws_account_id string The AWS account ID when using an aws_account_id configuration required (for aws_account_id configs)
aws_access_key_id string The AWS access key ID when using an aws_secret_key configuration required (for aws_secret_key configs)
aws_secret_access_key string The AWS secret access key when using an aws_secret_key configuration required (for aws_secret_key configs)
app_ids array of strings The identifiers of apps to export data from required (at least one)
sor_ids array of strings The identifiers of systems of records to export attributes data from required (at least one only when exporting attributes)
exported_data array of strings The types of data to export. Choose from sessions, logs, details, locations, devices, crashes, campaign_results_per_user, attributes required (at least one)

Example

{
  "name": "Test new exporter",
  "export_configuration": "aws_secret_key",
  "aws_region": "eu-west-1",
  "bucket_name": "test-bucket",
  "aws_access_key_id": "1a2b3c4d5e6f7g8h9i",
  "aws_secret_access_key": "1234567890987654321abcdefghij",
  "app_ids": [
    "FAAPPLI_abcdefghij"
  ],
  "sor_ids": [
    "SOR-SDK_2a116e0767a7dc76e85a5ef85434d92b"
  ],
  "exported_data": [
    "sessions",
    "logs",
    "details",
    "locations",
    "app_devices",
    "campaign_results_per_user",
    "crashes_values",
    "attributes"
  ]
}

Response

Status: 200 OK

{
  "success": true,
  "result": {
      "identifier": "FAAUTOXPRT__-gjS0d7vrc",
      "name": "test99",
      "type": "obos",
      "active": false,
      "apps": [
        {
          "name": "Some app name",
          "identifier": "FAAPPLI_abcdefghij",
          "package_name": "app.package.name",
          "platform": "Android App "
        }
      ],
      "subfolder": "",
      "exported_data": [
        "sessions",
        "logs",
        "details",
        "locations",
        "app_devices",
        "campaign_results_per_user",
        "crashes_values",
        "attributes"
      ],
      "initial_run_at": null,
      "last_run_at": null,
      "sors": [
        {
          "name": null,
          "identifier": "SOR-SDK_2a116e0767a7dc76e85a5ef85434d92b",
          "type": "CustomerProfile::AppSOR"
        }
      ],
      "bucket_name": "test-bucket",
      "aws_region": "eu-west-1",
      "exports": {},
      "aws_access_key_id": "1a2b3c4d5e6f7g8h9i",
      "aws_secret_access_key": "1234567890987654321abcdefghij"
  }
}

Update

PUT /api/data_exporters/identifier

Query Parameters

Property Type Description Default
identifier string The identifier of the data exporter to update required

Body Parameters

NOTE: Just pass the parameters that you want to change in the exporter.

Property Type Description Default
name string A name for your exporter -
export_configuration string The type of the exporter, either aws_account_id (using an AWS account ID), aws_secret_key (using a pair of AWS access and secret keys) required
bucket_name string The name of the S3 bucket to export data to required
subfolder string The name of a sub folder inside the S3 bucket -
aws_region string The region where the S3 bucket is located eu-west-1
aws_account_id string The AWS account ID when using an aws_account_id configuration required (for aws_account_id configs)
aws_access_key_id string The AWS access key ID when using an aws_secret_key configuration required (for aws_secret_key configs)
aws_secret_access_key string The AWS secret access key when using an aws_secret_key configuration required (for aws_secret_key configs)
app_ids array of strings The identifiers of apps to export data from required (at least one)
sor_ids array of strings The identifiers of systems of records to export attributes data from required (at least one when exporting attributes)
exported_data array of strings The types of data to export. Choose from sessions, logs, details, locations, devices, crashes, campaign_results_per_user, attributes required (at least one)

Example (changing the name)

{
    "name": "New test exporter name",
    "sor_ids": ["SOR-SDK_2a116e0767a7dc76e85a5ef85434d92b"]
    "exported_data": [
      "details",
      "attributes",
      "devices"
    ]
}

Response

NOTE: The response JSON will be the same as the view endpoint, except the fields asked to be changed will have their new values.

Status: 200 OK

{
  "success": true,
  "result": {
    ...,
    "name": "New test exporter name",
    "exported_data": [
      "details",
      "attributes",
      "devices"
    ],
    "sor_ids": [
      "SOR-SDK_2a116e0767a7dc76e85a5ef85434d92b"
    ]
    ...
  }
}

Delete

DELETE /api/data_exporters/identifier

This API endpoint deletes an exporter. This action is irreversible.

Query Parameters

Property Type Description Default
identifier string The identifier of the exporter to delete required

Response

NOTE: The response JSON will be the same as the view endpoint, showing the information about the exporter that was just deleted.

Activate & Deactivate

PUT /api/data_exporters/identifier/activate

PUT /api/data_exporters/identifier/deactivate

These API endpoints either activate or deactivate an exporter. Active exporters will automatically export data on a daily basis.

Query Parameters

Property Type Description Default
identifier string The identifier of the exporter to activate/deactivate required

Response

NOTE: The response JSON will be the same as the view endpoint, except the active value will become either true or false.

Status: 200 OK

{
  "success": true,
  "result": {
    ...,
    "active": true/false,
    ...
  }
}

Export Info

GET /api/data_exporters/identifier/exports/_export_identifier

This API endpoint fetches information about a single export done.

Query Parameters

Property Type Description Default
identifier string The identifier of the exporter required
export_identifier string The identifier of the specific export required

Response

NOTE: The response JSON will be the same as the view endpoint, except the active value will become false.

Status: 200 OK

{
  "identifier": "FADATAEXP_abcdef123456",
  "date": "2020-04-01",
  "type": "sessions",
  "total_files": 5,
  "total_exported": 5
}