Update A User

This API available only for user access-token integration

Endpoint allows updating fields in a User by its IDon the Graph or by externalUserId. In the JSON request body, include a JsonPatch patch object that specifies the operation to perform, one or more fields to update, and a new value for each updated field.

Note: To know more about JsonPatch take a look at JsonPatch website.

Update Recipe

PATCH /v1/me

Path Parameters

Request Body

{
  "id": "3d4fda8595114a3a9f7b12fd471a4169",
  "externalId": "1654732567",
  "email": "[email protected]",
  "firstName": "John",
  "lastName": "Doe",
  "displayName": "John Doe",
  "pictureUrl": "http://john.doe.picture.url.jpg",
  "updatedAt": 1524150524000,
  "createAt": 1524150524000,
  "preferences": {
    "diets": [
      "vegetarian",
      "vegan"
    ],
    "avoidances": [
      "egg",
      "celery"
    ],
    "dislikedIngredients": [
      {
        "name": "milk"
      }
    ],
    "householdSizeAdults": 2,
    "householdSizeChildren": 1,
    "gender": "male",
    "cookingSkill": "amateur",
    "language": "ko",
    "country": "kr"
  }
}

Sample Request

curl "https://graph.whisk.com/v1/users" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <Access-Token>" \
  -d '[
    {
      "op": "remove",
      "path": "/email"
    },
    {
      "op": "replace",
      "path": "/displayName",
      "value": "John Doe"
    },
    {
      "op": "add",
      "path": "/pictureUrl",
      "value": ""
    }
  ]'

Response

UserPreferences

Last updated