Get all Organizations of User

This endpoint retrieves all Organizations a specific User is assigned to, along with the User's Role in each one

Request

To retrieve all Organizations of a User, please make a GET request to the following URL:

HTTP MethodURL
GEThttps://industrial.api.ubidots.com/api/v2.0/users/<user_key>/organizations/

Path Parameters

ParameterTypeUse
user_keyStringThe id or username of the User, username should use the prefix ~

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthorization Token can optionally be sent as a query parameter.
fieldsStringOptionalComma-separated list of the fields to return, e.g. ?fields=id,label,role.
sort_byStringOptionalSort the results by createdAt, label or name. Default order is newest first.

The results can also be narrowed down with the Organization filters, for example ?label__startswith=customer.

Header

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/users/~john-doe/organizations/' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
{
  "count": 2,
  "next": null,
  "previous": null,
  "results": [
    {
      "url": "https://industrial.api.ubidots.com/api/v2.0/organizations/62b4eb3519cd98007bf410bf",
      "id": "62b4eb3519cd98007bf410bf",
      "label": "my-third-customer",
      "name": "Cliente1",
      "createdAt": "2022-06-23T22:37:41.840643Z",
      "role": {
        "url": "https://industrial.api.ubidots.com/api/v2.0/roles/viewer",
        "label": "viewer",
        "name": "Viewer",
        "createdAt": "2022-06-02T13:06:50.616480Z"
      }
    },
    {
      "url": "https://industrial.api.ubidots.com/api/v2.0/organizations/6298b72cb8f9ee01abd67001",
      "id": "6298b72cb8f9ee01abd67001",
      "label": "my-first-customer",
      "name": "Cliente0",
      "createdAt": "2022-06-02T13:12:12.267973Z",
      "role": {
        "url": "https://industrial.api.ubidots.com/api/v2.0/roles/manager",
        "label": "manager",
        "name": "Manager",
        "createdAt": "2022-06-02T13:06:50.616480Z"
      }
    }
  ]
}
{
  "code": 401002,
  "message": "Incorrect authentication credentials."
}
{
  "code": 404001,
  "message": "The request was not found.",
  "detail": "The request was not found."
}

Response

Returns a paginated list of Organization Objects (summary fields) the User is assigned to. Each item includes the role the User has in that Organization.