Integrating an External Application for B2C
IMPORTANT: For legibility the "\" at the end of each line were removed
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"createUser",
"params": {
"email":"test1@oneoffice.bh",
"instance":1,
"displayName":
"TestUser",
"password":"demo1234"
}
}'
STATUS: 200
BODY:
{
"email":"none2@test.oneoffice.ca",
"displayName":"New User",
"profile": {
"uid":null,
"title":null,
"department":null,
"location":null,
"phones":[],
"grade":null
},
"isAdmin":false,
"apps":"{0,0,0}",
"createdAt":1683471262,
"settings":"{84,213,10,92}",
"values": {
"notificationReminder":3,
"timezone":null,
"editorTemplates":null
},
"id":2,
"mainCalendar":2,
"inbox":7,
"spam":8,
"sent":9,
"trashEmail":10,
"drafts":12,
"rootFiles":3,
"trashFiles":4
}
curl -v \
-X GET $URL \
--header "x-api-key: ${BEARER}" \
--header 'Content-Type: application/json' \
--data '{
"method":"createUser",
"params": {
"email":"test1@oneoffice.bh",
"password":"demo1234"
}
}'
STATUS: 400
BODY:
"duplicate key value violates unique constraint \"users_email\""
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"updateUserByEmail",
"params":{
"email":"test1@oneoffice.bh",
"isActive":false
}
}'
STATUS: 200
BODY: true
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"updateUserByEmail",
"params": {
"email":"test1@oneoffice.bh",
"isActive":true
}
}
STATUS: 200 BODY: true
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"resetPasswordByEmail",
"params":{
"email":"test1@oneoffice.bh",
"password":"onemoretime"
}
}'
STATUS: 200 BODY: true
curl -v
-X GET $URL
--header "x-api-key: ${BEARER}"
--header 'Content-Type: application/json'
--data '{
"method":"getUserByEmail",
"params": {
"email":"test1@oneoffice.bh"
}
}'
STATUS: 200 BODY:
{
"id":2,
"instance":1,
"email":"none@test.oneoffice.ca",
"avatar":"",
"groups":[],
"settings":[84,213,10,92],
"apps":[0,0,0],
"values":{
"timezone":null,
"editorTemplates":null,
"notificationReminder":3
},
"profile":{
"uid":null,
"grade":null,
"title":null,
"phones":[],
"location":null,
"department":null
},
"displayName":"John Smith",
"isActive":true,
"isAdmin":false,
"isSysAdmin":false,
"rootFiles":3,
"trashFiles":4,
"inbox":7,
"spam":8,
"sent":9,
"trashEmail":10,
"drafts":12,
"mainCalendar":2,
"token":"",
tokenExpiresAt":0
}