Skip to content

Update users

Updates a user or multiple users

Endpoint URI

1
PUT https://services.ownpage.fr/v1/users

Headers

  • X-Ownpage-Client-Token : a valid token

Payload (JSON)

The data should be a JSON array of users. Each user can have these parameters :

  • email : (mandatory) the user's email address
  • new_email : the new user's email address
  • guid : the ID of the user in your database. This id must match the one used in navigation tracking. If not provided, the value of the guid is md5(email)
  • data_* : you can attach additional data to your users using parameters prefixed by data_. Example : data_firstname

    Payload is limited to 20.000 users per request.

Response

The response is a summary of what has been done during the call. You can find different information, such as :

  • errors : errors detected in your payload
  • unique_emails_count : number of unique users found in the payload
  • duplicate_emails_count : number of users ignored because their address is present several times in the payload
  • duplicate_guid_count : number of users ignored because their guid is present several times in the payload
  • nb_data_changed : number of users which had their data attributes (first_name, last_name...) changed by your request

Example

We update the email of a user

1
curl -X PUT --header "X-Ownpage-Client-Token:TOKEN" --header "Content-Type:application/json" --data REQUEST_DATA https://services.ownpage.fr/v1/users

With REQUEST_DATA:

1
2
3
4
[{ 
    "email" : "jean-l@provider.com", 
    "new_email" : "jean-l@new-provider.com"
}]

Response:

1
2
3
4
5
6
7
8
9
{
    "report": {
        "errors": [],
        "unique_emails_count": 1,
        "duplicate_emails_count": 0,
        "duplicate_guid_count": 0,
        "nb_data_changed": 1
    }
}

Comments