Adding a User via the REST API
Description | Add a new user to WSO2 EMM using the REST API given below. | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Resource Path | / | ||||||||||||||||||
URL | /mdm-admin/users/ | ||||||||||||||||||
HTTP Method | POST | ||||||||||||||||||
Request/Response Format | application/json | ||||||||||||||||||
cURL command | curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer <EMM_API_TOKEN>" -d @'<JSON_PAYLOAD>' -k -v https://<EMM_HOST>:<EMM_HTTPS_PORT>/mdm-admin/users/
Example: curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a" -d @'user.json' -k -v https://localhost:9443/mdm-admin/users/ | ||||||||||||||||||
 Sample output | > POST /mdm-admin/users/ HTTP/1.1 > Host: localhost:9443 > User-Agent: curl/7.43.0 > Accept: */* > Content-Type: application/json > Authorization: Bearer 33392fb365b3ac693b405b565ddc8a3a > Content-Length: 131 < HTTP/1.1 201 Created < Date: Sat, 05 Mar 2016 09:12:23 GMT < Content-Type: application/json < Content-Length: 94 < Server: WSO2 Carbon Server {"statusCode":201,"messageFromServer":"User by username: PRIMARY/kim was successfully added."} | ||||||||||||||||||
Sample JSON Definition | { "username":"PRIMARY/kim", "firstname":"Kim", "lastname":"Bar", "emailAddress":"kim@gmail.com", "roles":[ "Marketing" ] }
|