Fuselage
Powered By GitBook
Update own basic information
URL
Requires Auth
HTTP Method
/api/v1/users.updateOwnBasicInfo
yes
POST
Note
    To update the password or email for the user you must send currentPassword property encrypted in SHA256 together in payload.
    To save customFields you must first define the customFields in admin panel (Accounts -> Registration -> Custom fields)

Payload

Argument
Example
Required
Description
data.email
Optional
The email address for the user.
data.name
Example User
Optional
The display name of the user.
data.username
example
Optional
The username for the user.
data.currentPassword
Optional
The password for the user encrypted in SHA256.
data.newPassword
passw0rd
Optional
The new password for the user
customFields
{ twitter: '@example' }
Optional Default: undefined
Any custom fields the user should have on their account.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
-H "Content-type:application/json" \
4
http://localhost:3000/api/v1/users.updateOwnBasicInfo \
5
-d '"data" :{"email": "[email protected]", "newPassword": "passw0rd",
6
"currentPassword": "5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5",
7
"username": "rocket.cat", name": "Example user" }'
Copied!

Example Result

1
{
2
"user": {
3
"_id": "47cRd58HnWwpqxhaZ",
4
"createdAt": "2018-03-09T13:17:11.951Z",
5
"services": {
6
"password": {
7
"bcrypt": "$2a$10$zb/dp.AHZAhwPzgmOHcQA.5eOfu6pAYU5gchg3O74z7XzWAppJflq"
8
},
9
"email": {
10
"verificationTokens": [
11
{
12
"token": "rzDjTJBoN8qdc5LCVM3xqaRHEx0lR9mxkFutB6fv-YP",
13
"address": "[email protected]",
14
"when": "2018-03-09T13:17:11.968Z"
15
},
16
{
17
"token": "bFdoXbtvVl4NYXNMQn-sb6t9TWwuBYkkntakvkNqyzr",
18
"address": "[email protected]",
19
"when": "2018-03-09T13:18:33.414Z"
20
},
21
{
22
"token": "reYkTD_OfKHYgU1p6ON-UyJjvXGODl6EoZ-GLQlg81s",
23
"address": "[email protected]",
24
"when": "2018-03-09T14:41:21.633Z"
25
}
26
]
27
},
28
"resume": {
29
"loginTokens": [
30
{
31
"when": "2018-03-09T13:17:12.110Z",
32
"hashedToken": "T6sIP43ctqMedzVsxiF/dln27ua7l56/Rys+aq7J2JA="
33
},
34
{
35
"hashedToken": "0z7NG4SFO00ZvR71nNqAhK0yv/9OeGJ74WZWAUxzAwA="
36
}
37
]
38
}
39
},
40
"emails": [
41
{
42
"address": "[email protected]",
43
"verified": false
44
}
45
],
46
"type": "user",
47
"status": "online",
48
"active": true,
49
"name": "Example User",
50
"_updatedAt": "2018-03-09T20:21:08.992Z",
51
"roles": [
52
"admin",
53
"user",
54
"bot"
55
],
56
"lastLogin": "2018-03-09T20:15:20.019Z",
57
"statusConnection": "online",
58
"utcOffset": -3,
59
"username": "rocket.cat",
60
"settings": {
61
"profile": {}
62
},
63
"customFields": {
64
"twitter": "userstwitter"
65
}
66
},
67
"success": true
68
}
Copied!

Change Log

Version
Description
0.62.2
Added as user.updateOwnBasicInfo
Last modified 6mo ago
Export as PDF
Copy link