GET https://www.cobot.me/api/user
This returns the information about the current user.
GET https://www.cobot.me/api/user
Response:
{ "id": "user-langalex", "email": "alex@example.com", "memberships": [ { "id": "37856087504", "space_subdomain": "some-space", "space_name": "Some Space", "space_link": "https://www.cobot.me/api/spaces/some-space", "link": "https://some-space.cobot.me/api/memberships/some-membership" } ], "admin_of": [ { "space_subdomain": "some-space", "space_name": "Some Space", "space_link": "https://www.cobot.me/api/spaces/some-space", "name": "John" } ] }
Important: apps authenticating users againt Cobot must not use the email address as an identifier as users can change it. Instead they must use the user id.
GET https://www.cobot.me/api/users/:id/picture
Redirects to the user's picture, so can be used within an image tag in order to always display the user's up-to-date picture.
Since we removed user photos, this endpoint now always redirects to a placeholder photo. User membership photos instead.
POST https://www.cobot.me/api/users
This creates a new user.
URL:
POST https://www.cobot.me/api/users
Body:
{ "email": "joe@doe.com", "password": "abebfpiafge7p9gba9pebd8aovA#" }
Response:
{ "id": "3207948075804", "email": "joe@doe.com", "grant_code": "34976f76a88d7de8664af877c" }
If you don't supply a password a random one will be generated.
The application that created the user is automatically granted access to the user's information. Use the grant_code from the response to get an access token for the new user.
Response status is 201 on success, 422 if the user is invalid. Additionally the errors are returned like this:
{"errors": {"email": "is invalid"}}
The new user's email address will already be confirmed and Cobot won't send out a confirmation email. It's the application's responsibility to validate the email address of the user.
PUT https://www.cobot.me/api/user/password
Updates user password.
URL:
PUT https://www.cobot.me/api/user/password
Body:
{ "password": "secret_password" }
Response:
Empty response with 204 code.