Get Organization of User

This endpoint retrieves a specific Organization of a User, along with the User's Role in it

Request

To retrieve a single Organization 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/<organization_key>/

Path Parameters

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

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthorization Token can optionally be sent as a query parameter.

Header

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
$ curl -X GET 'https://industrial.api.ubidots.com/api/v2.0/users/~john-doe/organizations/~my-third-customer/' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
{
  "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"
  }
}
{
  "code": 401002,
  "message": "Incorrect authentication credentials."
}
{
  "code": 404001,
  "message": "The request was not found.",
  "detail": "The request was not found."
}

Response

Returns the Organization Object (summary fields) with the role the User has in it. Returns 404 if the User is not assigned to that Organization.