Profile attributes
Transmits user parameters.
Usage example: You can send user parameters to the Post API to supplement user profiles and use this data for audience-based segmentation. For example, add an attribute indicating that the user is a loyalty program member.
Event properties can be passed in parameters or in the body of the request. When you pass data in the body, you should add .csv
to the URL of the request. For more information, see Sample request.
To bind an event to a user, you should use one of the following fields in the API request:
profile_id
appmetrica_device_id
Alert
The Post API has restrictions on loading data. For more information, see Restrictions.
Request format
POST https://api.appmetrica.yandex.ru/logs/v1/import/profiles
? post_api_key=<string>
& application_id=<int>
& profile_id=<string>
& attributes=<>
|
A token for data uploading. You can get it in the Settings section of your application. |
|
Unique numeric identifier for the application in AppMetrica. |
|
User profile ID. The Post API allows you only to upload data for identifiers that were previously sent via the SDK. Alert Do not pass the value with the |
|
A set of custom attribute values in Alert To collect custom profile attributes, add them in the app settings. To do this, open the app page, select Settings, and click Profile attributes. |
Response codes
Code | Description |
---|---|
200 | Data has been uploaded successfully. |
403 | The request omitted an authorization header, or an invalid token was specified. |
400 | One or more required parameters were missing in the request. |
Sample request
POST /logs/v1/import/profiles.csv?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012 HTTP/1.1
Host: api.appmetrica.yandex.ru
Connection: close
application_id,profile_id,attributes
1234567890,1234567890abcdef,"{""string_attribute_name"":""string_value"",""number_attribute_name"":1234,""bool_attribute_name"":true,""counter_attribute_name"":-1}"
POST /logs/v1/import/profiles?post_api_key=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012&application_id=1234567890&profile_id=1234567890abcdef&attributes={"string_attribute_name":"string_value","number_attribute_name":1234,"bool_attribute_name":true,"counter_attribute_name":-1} HTTP/1.1
Host: api.appmetrica.yandex.ru
Content-Length: 0
Connection: close
You can only use the Post API to change the user's custom attributes. To deliver predefined attributes, use the AppMetrica SDK. For more information, see Set up sending profile attributes.
Other Post API methods
- Uploading events
- Uploading In-App Revenue events
- Uploading Ad Revenue events
- Uploading E-commerce events
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.