Update User Profile
Update a user profile
HTTP Request
- cURL
- JavaScript
curl -v -X POST \
'https://apistg.ahamove.com/v1/user/update_profile' \
-H 'cache-control: no-cache'
-d '{
"token": <TOKEN_STG>,
"name": "John Doe",
"email": "johndoe@gmail.com",
"user_type": "SMEs",
"categories": [
{
"code": "FOOD",
"child_code": [
"VIETNAMESE SPECIALTIES",
"ICE-CREAM",
"PHO & NOODLES"
]
},
{
"code": "DRINK",
"child_code": [
"MILK TEA",
"SMOOTHIE & JUICE",
"BEVERAGE"
]
}
]
}'
var myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
var raw = JSON.stringify({
token: '<TOKEN_STG>',
name: 'John Doe',
email: 'johndoe@gmail.com',
user_type: 'SMEs',
categories: [
{
code: 'FOOD',
child_code: ['VIETNAMESE SPECIALTIES', 'ICE-CREAM', 'PHO & NOODLES'],
},
{
code: 'DRINK',
child_code: ['MILK TEA', 'SMOOTHIE & JUICE', 'BEVERAGE'],
},
],
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('https://apistg.ahamove.com/v1/user/update_profile', requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
POST https://apistg.ahamove.com/v1/user/update_profile
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | String | Yes | Token. |
name | String | No | User Name. |
String | No | Email. |
Response
JSON response example:
{}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
404 | Not Found | Token not found. |
409 | Conflict | Email existed. |
406 | Not Acceptable | Email not valid. |
400 | Bad Request | Invalid user type and categories. |
500 | Internal Server Error | We had a problem with our server. Try again later. |
503 | Service Unavailable | We're temporarily offline for maintenance. Please try again later. |