Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix bulk-identities API example #4195

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions docs/docs/clients/rest.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,41 @@ assert delete_identity_response.status_code == 204

### Bulk Uploading Identities and Traits

You can achieve this with a `POST` to the `identities` endpoint:
You can achieve this with a `POST` to the `bulk-identities` endpoint:

```bash
curl -X "POST" "https://edge.api.flagsmith.com/api/v1/identities/?identifier=<identity_id>" \
-H 'X-Environment-Key: <Your Environment Key>' \
-H 'Content-Type: application/json; charset=utf-8' \
curl -i -X POST "https://edge.api.flagsmith.com/api/v1/bulk-identities" \
-H "X-Environment-Key: ${FLAGSMITH_ENVIRONMENT_KEY}" \
-H 'Content-Type: application/json' \
-d $'{
"traits": "traits": [
{
"trait_key": "this_key",
"trait_value": "this_value"
},
{
"trait_key": "this_key2",
"trait_value": "this_value2"
}
],
"identifier": "<identity_id>"
}'
"data": [
{
"identifier": "my_identifier_1",
"traits": [
{
"trait_key": "my_key_name",
"trait_value": "set from POST /bulk-identities"
}
]
},
{
"identifier": "my_identifier_2",
"traits": [
{
"trait_key": "some_other_key_name",
"trait_value": "if this identity does not exist, it will be created by this request"
}
]
},
{
"identifier": "my_identifier_3",
"traits": [
{
"trait_key": "this_trait_will_be_deleted",
"trait_value": null
}
]
}
]
}'
```
Loading