Update a User

This API avialable only for user access-token integration
PATCH
/v1beta/me

Endpoint allows to update fields in a User by it's ID on 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

Request parameters

ATTRIBUTETYPEDESCRIPTION
id*string

User Id on the Graph or User external Id

Request Body

ATTRIBUTETYPEDESCRIPTION
op*string

The operation to perform: Add, Remove, Replace, Copy, Move, Test

path*string
fromstring
valuestring

Sample Request

curl "https://graph.whisk.com/v1beta/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

ATTRIBUTETYPEDESCRIPTION
id*string

The id of the User on Whisk Graph

externalUserIdstring

The user id you have defined for the user. (Max limit of 255 UTF-8 characters, and should not have trailing or leading spaces)

emailstring

The email you have defined for the user. (Max limit of 255 UTF-8 characters, and should not have trailing or leading spaces)

firstNamestring

The first name of the user

lastNamestring

The last name of the user

displayNamestring

The display name of the user

createdAt*timestamp

The time the user was added to Whisk

updatedAt*timestamp

The last time the user was updated

pictureUrlstring

The profile picture url of a user

preferencesUserPreferences

UserPreferences

ATTRIBUTETYPEDESCRIPTION
countrystring

Country iso code. Examples: gb, kr, us...

zipCodestring

Postal code. Examples: 10001, 80333...

languagestring

Language iso code. Examples: en, ko, fr...

cookingSkillenum

Measure of a person’s competence in preparing and cooking foods

Possible values: amateur, intermediate, advanced.
genderenum
Possible values: female, male.
householdSizeChildreninteger

Number of children

householdSizeAdultsinteger

Number of adults

Default value: 1
dislikedIngredientsarray [string]

Products and ingridients which will be excluded in searcd and feed APIs.

dietsarray [string]
avoidancesarray [string]

Sample Response

{ "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" } }