MyRapidi
MyRapidi

Search our Wiki

Create Group

Below you see an example on how to create a group. Examples both in JSON and JSONAPI are provided.

NOTE: Remember to substitute the token (after Bearer) and the service id (the "[SERVICE ID]" below) to your own token and service id.

JSON:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/json" 
  -H "Accept: application/json"
  -X POST
  -d "{\"code\":\"GR002\",\"description\":\"new group\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups

The out-put for this example would be:

{
 "code": "GR002",
 "description": "new group",
 "comments": []
}

JSONAPI:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X POST
  -d "{\"data\":{\"type\":\"groups\",\"attributes\": {\"code\":\"GRP000\",\"description\":\"new group\"} }}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups

The out-put for this example would be:

{
  "data": {
    "id":"21",
    "type": "groups",
    "attributes":{
      "code": "GRP000",
      "description": "new group"
    },
    "relationships": {
      "comments": {
        "data": []
      }
    }
  }
}