MyRapidi
MyRapidi

Search our Wiki

REST API Schedule Tags Update Schedule Tags

Below you see an example of how to update the Schedule Tags from a specific Schedule. 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
  data = "{\"value\":\"NAV005\"}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules/171/tags/101

The out-put for this example would be:

{
  "id": "101",
  "code": "DS",
  "value": "NAV005"
}

JSONAPI:

Update Schedule Tags from a specific Schedule:

curl 
  -H "Authorization: Bearer [API SECURITY TOKEN]"
  -H "Content-Type: application/vnd.api+json" 
  -H "Accept: application/vnd.api+json"
  -X PATCH
  data = "{\"data\":{\"type\":\"schedule_tags\",\"attributes\": {\"value\":\"NAV005\"} }}"
  https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules/171/tags/101

The out-put for this example would be:

{
  "data": {
    "id": "101",
    "type": "schedule_tags",
    "attributes": {
      "code": "DS",
      "value": "NAV005"
    }
  }
}

TIP: As you would need the Schedule ID you can run your list of Schedules before to get the Schedule ID and to get an overview where you have different Schedule Tags attached.