-1

Could someone help me to understand what a specific example of an API link would look like for the following API?

https://engradesandbox.com/docs/

They show examples in the documentation about what the JSON result/return of an API, but not an actual example of what a call would look like.

I've noticed this with most API's, they show the possible result data, but not the default url syntax. It's so frustrating, because looking through existing restful tutorials isn't very fruitful on the subject either. How do you know what the actual API call should look like?

apaderno
  • 28,547
  • 16
  • 75
  • 90
Eleanor Zimmermann
  • 414
  • 1
  • 8
  • 26

1 Answers1

1

That actually does tell you you what to do.

All "calls" will be HTTP POST to the URL specified. If you click on one of them, it takes you to a page that explains the input data for that method.

For example, see the class-behavior-add function. To call that function, you'd post to the URL they specify (https://api.engradesandbox.com/ as of this posting), and the content of your post would be XML or JSON that contains the fields specified here.

Example post data as JSON:

{
    "apitask": "class-behavior-add",
    "apikey": "your_api_key",
    "ses": "session token id",
    "clid": 1234567890,
    "stuid": "student ID",
    "date": 123456789,
    "mark": 12,
    "points": 123
}

Example post data as XML:

<engrade>
    <apitask>class-behavior-add</apitask>
    <apikey>your_api_key</apikey>
    <ses>session token id</ses>
    <clid>1234567890</clid>
    <stuid>student ID</stuid>
    <date>123456789</date>
    <mark>12</mark>
    <points>123</points>
</engrade>
dodexahedron
  • 4,584
  • 1
  • 25
  • 37