Update User Profile
Updates a user's profile details.
Note: Due to fraud protections, guests are permitted to update their birthdays only once. Subsequent attempts to modify the birthday parameter using the API will fail. In such a case, the API returns a 200 response, but the birthday is not updated.
- Type: stringAuthorizationrequired
Used to authorize the request with access_token. It should be supplied as
Bearer ACCESS_TOKEN_GOES_HERE. - Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringpunchh
-app -device -id requiredThe app device ID helps Punchh identify each device so that certain rewards can be awarded individually to each device instead of per user. For example, the sign-up reward is given to each device ID to prevent fraudulent sign-ups so that a user cannot do repeated sign-ups from a single device to get rewards. It should not change even if the user resets a device. See the sample code to generate the punchh-app-device-id header.
- Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringAccept
- Language Preferred language
- Type: stringUser
- Agent requiredUsed to identify the software, device, and application initiating the request, providing information about the client to the server. For details, see User Agent.
- Type: stringclientrequired
OAuth client ID provided by the business
- Type: objectuser
- application/json
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/api2/mobile/users \
--request PUT \
--header 'Authorization: Bearer ACCESS_TOKEN_GOES_HERE' \
--header 'x-pch-digest: {{$$.env.signature}}' \
--header 'punchh-app-device-id: APP_DEVICE_ID_GOES_HERE' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'User-Agent: AppName/AppVersion/BuildNumber (OS; Model; MANUFACTURER; MODEL; OS Version)' \
--data '{
"client": "CLIENT_GOES_HERE",
"user": {
"first_name": "FIRST_NAME_GOES_HERE",
"last_name": "LAST_NAME_GOES_HERE",
"avatar_remote_url": "URL_GOES_HERE",
"email": "test@example.com",
"current_password": "CURRENT_PASSWORD_GOES_HERE",
"password": "NEW_PASSWORD_GOES_HERE",
"password_confirmation": "NEW_PASSWORD_GOES_HERE",
"apn_token": "APN_TOKEN_GOES_HERE",
"gcm_token": "GCM_TOKEN_GOES_HERE",
"birthday": "",
"favourite_location_ids": "304155",
"secondary_email": "test@example.com",
"anniversary": "",
"zip_code": "70001",
"address": "ADDRESS_GOES_HERE",
"state": "Ohio",
"phone": "1111111111",
"gender": "male",
"profile_field_answers": {
"upf0": "Coffee|Tea|Lemonade",
"upf1": "Pasta|Pizza|Hamburger",
"upf2": "Movies|Music|Sports"
},
"age_verified_status": true
}
}'
{
"access_token": {
"token": "ACCESS_TOKEN_GOES_HERE",
"seconds_to_expire": null,
"revoked_at": null
},
"user": {
"address": "",
"avatar_remote_url": "IMAGE_URL_GOES_HERE",
"birthday": "1999-01-01",
"communicable_email": "test@example.com",
"city": "",
"created_at": "2015-11-02T18:14:32+00:00",
"email": "test@example.com",
"email_verified": false,
"facebook_signup": null,
"favourite_locations": "",
"favourite_store_numbers": "",
"fb_uid": "FB_UID_GOES_HERE",
"first_name": "FIRST_NAME_GOES_HERE",
"gender": "male",
"last_name": "LAST_NAME_GOES_HERE",
"marketing_email_subscription": true,
"marketing_pn_subscription": true,
"migrate_status": false,
"passcode_configured_for_giftcards": false,
"phone": "1111111111",
"profile_field_answers": {
"upf0": "Coffee|Tea|Lemonade",
"upf1": "Pasta|Pizza|Hamburger",
"upf2": "Movies|Music|Sports"
},
"referral_code": "REFERRAL_CODE_GOES_HERE",
"referral_path": "URL_GOES_HERE",
"secondary_email": "test@example.com",
"state": "Ohio",
"superuser": false,
"terms_and_conditions": false,
"title": "",
"updated_at": "2016-05-09T12:27:52+00:00",
"user_as_barcode": "1111111",
"user_as_qrcode": "QR_CODE_GOES_HERE",
"user_code": "P11111111",
"user_id": 111111111,
"user_relations": [],
"zip_code": "70001",
"anniversary": null,
"verification_mode": null,
"apple_signup": null,
"apple_uid": null,
"has_generated_fb_email": false,
"sms_subscription": true,
"apple_pass_url": "APPLE_PASS_URL_GOES_HERE",
"google_pass_url": "GOOGLE_PASS_URL_GOES_HERE",
"age_verified_status": true,
"user_joined_at": "2015-11-02T18:14:32+00:00"
}
}