登录
中文 EN RU

Request to export segment

Create a request to export segment to CSV files.

Only account owners and users with the granted export permission can export raw data from the account. For details, see User management.

Input data#复制链接

POST https://tracker.my.com/api/segment/v1/export/create.json

Parameters#复制链接

Name Value Description Note
idSegment * ID of one of the segments available to you

Example: 1 или
idSegment=1
ID of the segment to be exported
requestFields Some values of exported fields, separated by commas or array-based

Example: requestFields=gaid,idfa
The list of identifiers that will be present in the exporting. If the list is empty or not transmitted, all available fields will be exported The list of available fields depends on the audience type of the segment.
Segment by users:
  • idProject
  • idProjectUser
  • customUserId
Segment by devices:
  • idApp
  • idProfile
  • gaid
  • idfa
  • oaid
includeHeaderLine One of the values:
0 — off
1 — on (by default)

Example: includeHeaderLine=1
Adding the first line with column names to the first file
registerType One of the values:
0 — Do not modify (by default)
1 — Common
2 — Lower case
3 — Upper case

Example: registerType=1
Selecting register identifiers Register can be selected only for identifiers in the segment by devices:
  • gaid
  • idfa
  • oaid
hashType One of the values:
0 — No hashing (by default)
1 — MD5
2 — SHA256

Example: hashType=1
Hashing identifiers The list of hashed identifiers depends on the audience type of the segment.
Segment by users:
  • customUserId
Segment by devices:
  • gaid
  • idfa
  • oaid
maxBatchFileSize Maximum size in MB per file in the ZIP archive.

Integer in the range from 10 to 4 095.
Splitting the exported segment into multiple files If multipleFiles=0, it will generate a ZIP archive, where the size of files after unpacking does not exceed the specified value.

If multipleFiles=1, then instead of one ZIP archive, it will generate several CSV.GZ archives, each of which will not exceed the specified value when unpacked.
multipleFiles One of the values:
0 — off (by default)
1 — on
Valid only if the maxBatchFileSize parameter is set.

Pass multipleFiles=1 if you need to receive multiple CSV.GZ archives instead of a ZIP archive for multiple files.

* — required parameters

Identifiers description#复制链接

The table contains description of identifiers that can be export using the requestFields parameter.

Segment by devices
idApp App identifier in MyTracker
idProfile Device identifier in the app. It defines a pair of app+individual device
gaid Android advertising identifier (advertisingId)
idfa iOS advertising identifier
oaid Huawei advertising identifier
Segment by users
idProject Project identifier in MyTracker
idProjectUser User identifier in the project. It defines a pair of project + user (idProject + CustomUserId)
CustomUserID User identifier sent via SDK. It defines an individual user

Example query#复制链接

Use the create method to export identifiers gaid, idfa by segment with id=1:

/api/segment/v1/export/create.json?idSegment=1&requestFields=gaid,idfa

Responses#复制链接

Success#复制链接

A 200 status code indicates success. It will include an identifier of a new request in the idSegmentExport field:

{
  "code": 200,
  "message": "Ok",
  "data": {
    "idSegmentExport": "1"
  }
}

Errors#复制链接

A 400 status code indicates an error in parameters given. For example:

  • The requested segment (idSegment) cannot be export:
    {
      "code": 400,
      "message": "Bad Request",
      "data": {
        "error": {
          "detail": "Field \"idSegment\" is invalid"
        }
      }
    }

Restrictions#复制链接

  • A 403 status code indicates that the method needs authorization. Maybe you made mistakes or forgot to send authorization data.
    {
      "code": 403,
      "message": "Access denied",
      "data": null
    }
  • A 400 status code is returned when you sent a new request and exceeded the limit of request in a queue:
    {
      "code": 400,
      "message": "Bad Request",
      "data": {
        "error": {
          "detail": "Maximum number of simultaneous requests reached. Wait until there is space available in the queue.",
          "info": {
            "exports": [
              {
                "idSegmentExport": "1"
              }
            ]
          }
        }
      }
    }
  • A 400 status code is returned when you try to export a segment that is already in the process of being exported:
    {
      "code": 400,
      "message": "Bad Request",
      "data": {
        "error": {
          "detail": "This segment is already being exported"
        }
      }
    }
Was this article helpful?
Sorry, the translation has not been completed yet