MyRapidi
MyRapidi

Search our Wiki

Update Group

Below you see an example on how to update a group for example if you need to change the description. 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 PATCH
  -d "{\"code\":\"INVOICE_DK\",\"description\":\"Invoice Transfers DK\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/5

The out-put for this example would be:

{
  "code": "INVOICE_DK",
  "description": "Invoice Transfers DK",
  "comments": []
}

JSONAPI:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X PATCH
  -d "{\"data\":{\"id\":\"5\",\"type\":\"groups\",\"attributes\": {\"code\":\"INVOICE_DK\",\"description\":\"Invoice Transfers DK\"} }}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/groups/5

The out-put for this example would be:

{
  "data": {
    "id":"5",
    "type": "groups",
    "attributes":{
      "code": "INVOICE_DK",
      "description": "Invoice Transfers DK"
    },
    "relationships": {
      "comments": {
        "data": []
      }
    }
  }
}