Channex.io
  • Channex.io Documentation
  • About Channex & FAQ
  • Changelog
  • For OTA
    • Intro
    • Channex Shopping API
    • Open Channel API
  • FOR PMS
    • API Reference
    • API Rate Limits
    • Property Size Limits
    • Properties Collection
    • Property Users Collection
    • Groups Collection
    • Group Users Collection
    • Room Types Collection
    • Rate Plans Collection
    • Availability and Rates
    • Webhook Collection
    • Bookings Collection
    • Channel API
    • Photos Collection
    • Hotel Policy Collection
    • Facilities Collection
    • Taxes and Tax Sets
    • Messages Collection
    • Reviews Collection
    • Channel Codes
    • Channel IFrame
    • PMS Certification Tests
  • Guides
    • PMS Integration Guide
    • Best Practices Guide
    • Test Account for Booking.com
    • Test Accounts for Airbnb
    • Channex Retention Periods
    • Guide to PCI
  • Application Documentation
    • Overview of App Documentation
    • Dashboard
    • Properties and Groups Management
    • Property Tasks
    • Rooms Management
    • Inventory Management
    • Channels Management
    • Channel Log
    • Bookings Management
    • Availability Rules
    • API Key Access
    • Change Log Feature
  • Google Guide
    • Connect Google Channel
    • Google Vacation Rental
    • My Hotel Shop (MHS) Google
  • Channel Mapping Guides
    • Agoda
    • Airbnb
    • Booking.com
    • Ctrip / Trip.com
    • Despegar
    • Dida Travel
    • Emerging Travel
    • Expedia
    • Feratel
    • Getaroom
    • Hipcamp
    • Hostelworld
    • Hopper
    • Hopper Homes
    • Hotelbeds
    • HotelTonight
    • HyperGuest
    • HRS
    • Inntopia
    • Instant Booking Page
    • MakeMyTrip / Goibibo
    • Mg Bedbank
    • OpenGDS
    • Roibos
    • Traveloka
    • Tiket.com
    • VRBO
  • App Guide
    • Apaleo
    • PCI App
Powered by GitBook
On this page
  • Group Users List
  • Returns
  • Invite User to Group
  • Fields
  • Returns
  • Get Group User by ID
  • Returns
  • Update Group User
  • Fields
  • Returns
  • Withdraw Group User Access
  • Returns

Was this helpful?

  1. FOR PMS

Group Users Collection

API methods to work with Group Users

Group User is an association between a Group and a User, represents who can manage a group and all properties under the group with which role and access rights.

Group Users List

Retrieve list of Group Users associated with a Group.

Request:

GET https://staging.channex.io/api/v1/group_users?filter[group_id]=GROUP_ID

Success Response Example

Status Code: 200 OK

{
  "data": [
    {
      "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
      "type": "group_user"
      "attributes": {
        "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
        "overrides": null,
        "group_id": "52397a6e-c330-44f4-a293-47042d3a3607",
        "role": "owner",
        "user_id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184"
      },
      "relationships": {
        "group": {
          "data": {
            "id": "52397a6e-c330-44f4-a293-47042d3a3607",
            "type": "group"
          }
        },
        "user": {
          "data": {
            "id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184",
            "type": "user",
            "email": "user@channex.io",
            "name": "Channex User"
          }
        }
      }
    }
  ]
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
  "errors": {
    "code": "unauthorized",
    "title": "Unauthorized"
  }
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a list of Group User objects in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided.

Invite User to Group

Create a new Group User. By inviting a User into a Group, you are automatically granting access for this user to all properties in the Group.

Request:

POST https://staging.channex.io/api/v1/group_users

Query body (JSON):

{
  "invite": {
    "group_id": "52397a6e-c330-44f4-a293-47042d3a3607",
    "user_email": "other_user@channex.io",
    "role": "user",
    "overrides": {}
  }
}

Success Response Example

Status Code: 201 Created

{
  "data": {
    "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
    "type": "group_user"
    "attributes": {
      "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
      "overrides": null,
      "group_id": "52397a6e-c330-44f4-a293-47042d3a3607",
      "role": "owner",
      "user_id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184"
    },
    "relationships": {
      "group": {
        "data": {
          "id": "52397a6e-c330-44f4-a293-47042d3a3607",
          "type": "group"
        }
      },
      "user": {
        "data": {
          "id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184",
          "type": "user",
          "email": "user@channex.io",
          "name": "Channex User"
        }
      }
    }
  }
}

Bad Request Error Response

Status Code: 400 Bad Request

{
  "errors": {
    "code": "bad_request",
    "title": "Bad Request",
    "details": "User already invited"
  }
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
  "errors": {
    "code": "unauthorized",
    "title": "Unauthorized"
  }
}

Forbidden Error Response

Status Code: 403 Forbidden

{
  "errors": {
    "code": "forbidden",
    "title": "Forbidden"
  }
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
  "errors": {
    "code": "validation_error",
    "title": "Validation Error",
    "details": {
      "user_email": [
        "can't be blank"
      ]
    }
  }
}

Fields

group_id [required]

String with valid UUID for Group object what you would use as target for invitation.

user_email [required]

String with a valid email address of invited user. Note: If user is not registered at our system, we are create they account automatically and send email with instructions to on-board into channex.io.

role [required]

String with a valid role name. Right now you can use 2 roles - owner and user.

overrides [optional]

JSON Object with access policies overrides.

Returns

Success Method can return a Success result with 201 Created HTTP Code if operation is successful. Will contain a Group User object in the answer. Bad Request Error Method can return a Bad Request Error result with 400 Bad Request HTTP Code if provided user already invited. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided. Forbidden Error Method can return a Forbidden Error result with 403 Forbidden HTTP Code if current user not have permissions to invite user into provided property.

Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.

Get Group User by ID

Retrieve a Group User by ID.

Request:

GET https://staging.channex.io/api/v1/group_users/:id

Success Response Example

Status Code: 200 OK

{
  "data": {
    "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
    "type": "group_user"
    "attributes": {
      "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
      "overrides": null,
      "property_id": "52397a6e-c330-44f4-a293-47042d3a3607",
      "role": "owner",
      "user_id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184"
    },
    "relationships": {
      "group": {
        "data": {
          "id": "52397a6e-c330-44f4-a293-47042d3a3607",
          "type": "group"
        }
      },
      "user": {
        "data": {
          "id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184",
          "type": "user",
          "email": "user@channex.io",
          "name": "Channex User"
        }
      }
    }
  }
}

Validation Error Response

Status Code: 401 Unauthorized

{
  "errors": {
    "code": "unauthorized",
    "title": "Unauthorized"
  }
}

Forbidden Error Response

Status Code: 403 Forbidden

{
  "errors": {
    "code": "forbidden",
    "title": "Forbidden"
  }
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Group User object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided. Forbidden Error Method can return a Forbidden Error result with 403 Forbidden HTTP Code if current user not have permissions to call this action.

Update Group User

Update the Group User information.

Request:

PUT https://staging.channex.io/api/v1/group_users/:id

Query body (JSON):

{
  "group_user": {
    "role": "user",
    "overrides": null
  }
}

Success Response Example

Status Code: 200 OK

{
  "data": {
    "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
    "type": "group_user"
    "attributes": {
      "id": "776533f2-c10e-49d8-bddc-14b3e27c2a00",
      "overrides": null,
      "group_id": "52397a6e-c330-44f4-a293-47042d3a3607",
      "role": "owner",
      "user_id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184"
    },
    "relationships": {
      "group": {
        "data": {
          "id": "52397a6e-c330-44f4-a293-47042d3a3607",
          "type": "group"
        }
      },
      "user": {
        "data": {
          "id": "c9cfa184-5095-4ef2-bbe2-e723ffb49184",
          "type": "user",
          "email": "user@channex.io",
          "name": "Channex User"
        }
      }
    }
  }
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
  "errors": {
    "code": "unauthorized",
    "title": "Unauthorized"
  }
}

Forbidden Error Response

Status Code: 403 Forbidden

{
  "errors": {
    "code": "forbidden",
    "title": "Forbidden"
  }
}

Resource Not Found Error Response

Status Code: 404 Not Found

{
  "errors": {
    "code": "resource_not_found",
    "title": "Resource Not Found"
  }
}

Validation Error Response

Status Code: 422 Unprocessable Entity

{
  "errors": {
    "code": "validation_error",
    "title": "Validation Error",
    "details": {
      "role": [
        "can't be blank"
      ]
    }
  }
}

Fields

Through this method you can update only two fields - role and overrides. Please see Invite User to Group for more detailed information.

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Will contain a Group User object in the answer. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided. Forbidden Error Method can return a Forbidden Error result with 403 Forbidden HTTP Code if current user not have permissions to call this action. Resource Not Found Error Method can return a Resource Not Found Error result with 404 Not Found HTTP Code if requested Group User is not defined.

Validation Error Method can return a Validation Error result with 422 Unprocessable Entity HTTP Code if any validation rule is failed.

Withdraw Group User Access

Revoke Group User access to a specific Group.

Request:

DELETE https://staging.channex.io/api/v1/group_users/:id

Success Response Example

Status Code: 200 OK

{
  "meta": {
    "message": "Success"
  }
}

Bad Request Error Response

Status Code: 400 Bad Request

{
  "errors": {
    "code": "bad_request",
    "details": "User can not withdraw themself",
    "title": "Bad Request"
  }
}

Unauthorised Error Response

Status Code: 401 Unauthorized

{
  "errors": {
    "code": "unauthorized",
    "title": "Unauthorized"
  }
}

Forbidden Error Response

Status Code: 403 Forbidden

{
  "errors": {
    "code": "forbidden",
    "title": "Forbidden"
  }
}

Resource Not Found Error Response

Status Code: 404 Not Found

{
  "errors": {
    "code": "resource_not_found",
    "title": "Resource Not Found"
  }
}

Returns

Success Method can return a Success result with 200 OK HTTP Code if operation is successful. Bad Request Error Method can return a Bad Request Error result with 400 Bad Request HTTP Code if user will try to remove them self. Unauthorised Error Method can return a Unauthorised Error result with 401 Unauthorized HTTP Code if wrong Bearer Token provided. Forbidden Error Method can return a Forbidden Error result with 403 Forbidden HTTP Code if current user not have permissions to call this action. Resource Not Found Error Method can return a Resource Not Found Error result with 404 Not Found HTTP Code if requested Group User is not defined.

PreviousGroups CollectionNextRoom Types Collection

Last updated 4 years ago

Was this helpful?