<turbo-stream action="update" target="wiki_card"><template>

<h1>REST API Filtering</h1>
<div class="trix-content"><p>All GET requests can use filtering parameters to limit the response to only the data you need. Just pass in a filtering query parameter as shown below. You can use '&amp;' to add another filtering query parameter if more than one is needed.</p>
<p> </p>
<p>To test the filtering parameters, you can use the normal myrapidi.com user interface. Set some filters under Schedules and the URL will show the corresponding parameters to be used.</p>
<p></p>
<p><strong>JSON:</strong></p>
<p>For example:</p>
<pre class="card">curl 
 -H "Authorization: Bearer [API SECURITY TOKEN]"
 -H "Content-Type: application/json" 
 -H "Accept: application/json"
 -X GET
 https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules?schedulercode=[SCHEDULER ID]

or
curl 
 -H "Authorization: Bearer [API SECURITY TOKEN]"
 -H "Content-Type: application/json" 
 -H "Accept: application/json"
 -X GET
 https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules?schedulercode=[SCHEDULER ID]&amp;search=TEST
</pre>
<p>In the first url above you have the filtering query parameter 'schedulercode'. In the second url above we have included the search filter option with '&amp;search='</p>
<p>Other filtering options (for schedules) are 'groupcode','transfercode' and 'search'.</p>
<p> </p>
<p>The example could have the following response body:</p>
<pre class="card">[{
 "code": "G_TEST22",
 "description": "Group TEST22",
 "transfer": "",
 "group": "TEST22",
 "interval": 1,
 "interval_unit": "Weeks",
 "status": "Stopped",
 "error_handling": "Skip",
 "last_datetime": "2017-03-28T15:59:07Z",
 "next_datetime": "2017-04-05T17:27:00Z",
 "error_interval": 1,
 "error_interval_unit": "Days",
 "notify_interval": 2,
 "notify_interval_unit": "Hours",
 "notify_datetime": "2014-03-30T17:01:00Z",
 "start_time": "00:00:00Z",
 "end_time": "00:00:00Z",
 "monday": true,
 "tuesday": true,
 "wednesday": true,
 "thursday": true,
 "friday": true,
 "saturday": true,
 "sunday": true,
 "tags": [],
 "comments": []
}]
</pre>
<p><strong> JSONAPI:</strong></p>
<p>For example:</p>
<pre class="card">curl 
 -H Authorization: Bearer [API SECURITY TOKEN]
 -H "Content-Type: application/vnd.api+json" 
 -H "Accept: application/vnd.api+json"
 -X GET
 https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules?schedulercode=[SCHEDULER ID]

or

curl 
 -H Authorization: Bearer [API SECURITY TOKEN]
 -H "Content-Type: application/vnd.api+json" 
 -H "Accept: application/vnd.api+json"
 -X GET
 https://api.myrapidi.com/api/v2/service/[SERVICE ID]/schedules?schedulercode=[SCHEDULER ID]&amp;search=TEST
</pre>
<p>In the first url above you have the filtering query parameter 'schedulercode'. In the second url above we have included the search filter option with '&amp;search='</p>
<p>Other filtering options (for schedules) are 'groupcode','transfercode' and 'search'.</p>
<p> </p>
<p>The example would have the following response body:</p>
<pre class="card">{"data": [
 {
  "id": "14",
  "type": "schedules",
  "attributes": {
    "code": "G_TEST22",
    "description": "Group TEST22",
    "transfer": "",
    "group": "TEST22",
    "interval": 1,
    "interval_unit": "Weeks",
    "status": "Stopped",
    "error_handling": "Skip",
    "last_datetime": "2017-03-28T15:59:07Z",
    "next_datetime": "2017-04-05T17:27:00Z",
    "error_interval": 1,
    "error_interval_unit": "Days",
    "notify_interval": 2,
    "notify_interval_unit": "Hours",
    "notify_datetime": "2014-03-30T17:01:00Z",
    "start_time": "00:00:00Z",
    "end_time": "00:00:00Z",
    "monday": true,
    "tuesday": true,
    "wednesday": true,
    "thursday": true,
    "friday": true,
    "saturday": true,
    "sunday": true
  }
  "relationships": {
    "tags": {
     "data": [],
    },
    "comments": {
      "data": []
    }
  }
 }]
</pre></div>
</template></turbo-stream>

