Coach

read

Returns every matching row instead of just the first. See get vs read for details. Most filter arguments also accept an array of values, matched with an OR.

Request

GET

https://api.srating.io/v1/coach/read?coach_id=cf3f6a9d-0fe0-11ef-9686-72fab666226a&coach_id=d21f4a10-0fe0-11ef-9686-72fab666226a

POST

fetch('https://api.srating.io/v1', {
  'method': 'POST',
  'headers': {
    'Content-Type': 'application/json',
    'X-API-KEY': 'YOUR_API_KEY',
  },
  'body': JSON.stringify({
    'class': 'coach',
    'function': 'read',
    'arguments': {
      'coach_id': [
        'cf3f6a9d-0fe0-11ef-9686-72fab666226a',
        'd21f4a10-0fe0-11ef-9686-72fab666226a',
      ],
    }
  }),
}).then(response => {
  return response.json();
}).then(json => {
  console.log(json);
  return json;
}).catch(error => {
  console.log(error);
});

Response

{
  "cf3f6a9d-0fe0-11ef-9686-72fab666226a": {
    "coach_id": "cf3f6a9d-0fe0-11ef-9686-72fab666226a",
    "first_name": "Matt",
    "last_name": "Painter",
    "guid": "0e8f0ea6-0042-43b5-85c0-72ea08875219",
    "deleted": 0
  },
  "d21f4a10-0fe0-11ef-9686-72fab666226a": {
    "coach_id": "d21f4a10-0fe0-11ef-9686-72fab666226a",
    "first_name": "Rick",
    "last_name": "Barnes",
    "guid": "1f9c2e3d-4b5a-4c6d-8e7f-9a0b1c2d3e4f",
    "deleted": 0
  }
}

On this page