Streamline JSON requests/answers

This commit is contained in:
Maxime Dor
2017-09-17 15:46:58 +02:00
parent 8b6eadb9ab
commit 0182ec7251

View File

@@ -30,12 +30,11 @@ Encoding: JSON UTF-8
{ {
"auth": { "auth": {
"mxid": "@john.doe:example.org", "mxid": "@john.doe:example.org",
"localport": "john.doe", "localpart": "john.doe",
"domain": "example.org", "domain": "example.org",
"password": "passwordOfTheUser" "password": "passwordOfTheUser"
} }
} }
``` ```
#### Response Body #### Response Body
@@ -49,12 +48,16 @@ If the authentication fails:
``` ```
If the authentication succeed: If the authentication succeed:
`auth.profile` and any sub-member are all optional - `auth.id` supported values: `localpart`, `mxid`
- `auth.profile` and any sub-member are all optional
``` ```
{ {
"auth": { "auth": {
"success": true, "success": true,
"mxid": "@john.doe:example.org", "id": {
"type": "localpart",
"value": "john"
},
"profile": { "profile": {
"display_name": "John Doe", "display_name": "John Doe",
"three_pids": [ "three_pids": [
@@ -97,10 +100,12 @@ Encoding: JSON UTF-8
"lookup": { "lookup": {
"medium": "email", "medium": "email",
"address": "john.doe@example.org", "address": "john.doe@example.org",
"uid": "john" "id": {
"type": "mxisd",
"value": "@jane:example.org"
}
} }
} }
``` ```
#### Bulk #### Bulk
@@ -119,7 +124,7 @@ Encoding: JSON UTF-8
}, },
{ {
"medium": "msisdn", "medium": "msisdn",
"address: "123456789" "address": "123456789"
} }
] ]
} }
@@ -132,14 +137,19 @@ Encoding: JSON UTF-8
{ {
"medium": "email", "medium": "email",
"address": "john.doe@example.org", "address": "john.doe@example.org",
"uid": "john" "id": {
"type": "localpart",
"value": "john"
}
}, },
{ {
"medium": "msisdn", "medium": "msisdn",
"address: "123456789", "address": "123456789",
"uid": "jane" "id": {
"type": "mxisd",
"value": "@jane:example.org"
}
} }
] ]
} }
``` ```