itec - European Schoolnet
itec - European Schoolnet
itec - European Schoolnet
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
iTEC Project<br />
Title: ITEC-D10_2_V1-1 041102012.Docx<br />
The request (method invocation) is composed of four items:<br />
1. jsonrpc: protocol version number. It must be the string: “2.0”.<br />
2. id: request unique identifier that will be echoed in the response message.<br />
3. method name: just a string with the method name you wish to invoke.<br />
4. params: a (JSON) object passed to the method. The params structure will depend on the<br />
specific method being invoked.<br />
The response is composed of three items:<br />
1. jsonrpc: protocol version number. It must be the string: “2.0”.<br />
2. id: an echo of the request id.<br />
3. one of these parameters:<br />
a. result: JSON string produced by the invoked method. It is required on success,<br />
omitted on failure.<br />
b. error: JSON string explaining the error, issued by the JSON-RPC server. It is<br />
required on error, omitted on success.<br />
In method invocations params must follow its corresponding JSON schema. The schema<br />
completely specifies the data structure, required and optional fields, as well as the expected data<br />
types or enumerations. Please refer to Appendix III for more specific details.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Figure 14. Basic structure of methods requests and responses<br />
An example invocation of an API method (“Get.Feasible.Learning.Stories” in this case) using<br />
JSON-RPC is illustrated below:<br />
{<br />
"jsonrpc": "2.0",<br />
"id": "request-001",<br />
"method": "Get.Feasible.Learning.Stories",<br />
"params": [<br />
{<br />
"technical_setting_id": "tsVigo1",<br />
"learning_stories": [<br />
Page 29/96