Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision |
osrfhttp:opensrf_gateway [2016/09/21 10:37] – rjs7 | osrfhttp:opensrf_gateway [2018/10/23 09:14] – rjs7 |
---|
| |
======Examples:====== | ======Examples:====== |
| |
| =====Example 0: Check Evergreen version===== |
| |
| [[https://demo.evergreencatalog.com/osrf-gateway-v1?service=open-ils.circ&method=opensrf.open-ils.system.ils_version]] |
| |
| Returns this: |
| <code> |
| {"payload":["3-2-0"],"status":200} |
| </code> |
| |
=====Example 1: Retrieve a List of Circ Modifiers with Input Format and Return Format as JSON:===== | =====Example 1: Retrieve a List of Circ Modifiers with Input Format and Return Format as JSON:===== |
Both of these examples return the same values; the return and input types do not need to be explicitly stated when requesting JSON objects. | Both of these examples return the same values; the return and input types do not need to be explicitly stated when requesting JSON objects. |
<status>200</status> | <status>200</status> |
</response> | </response> |
| </code> |
| |
| =====Example 3: Authentication===== |
| |
| Login with the demo admin user: |
| |
| [[https://demo.evergreencatalog.com/osrf-gateway-v1?service=open-ils.auth&method=open-ils.auth.login¶m={"username":"admin","password":"demo123"}]] |
| |
| Returns this: |
| |
| <code> |
| { |
| "payload":[{ |
| "ilsevent":0, |
| "textcode":"SUCCESS", |
| "desc":"Success", |
| "pid":19776, |
| "stacktrace":"oils_auth.c:636", |
| "payload":{ |
| "authtoken":"5f0f7eebe600ed267be4085b660fe7be", |
| "authtime":7200 |
| } |
| }], |
| "status":200 |
| } |
</code> | </code> |
| |
======Return Status====== | ======Return Status====== |
OSRF methods will return a status as part of the JSON object or XML document. | OSRF methods will return a status as part of the JSON object or XML document. |
^ Status ^ Payload Contents ^ Recommendation ^ | ^ Status ^ Payload Contents ^ Recommendation ^ |
| 200 | The OpenSRF request is returned successfully; the //payload// contains the returned object (however, check the payload, as there may have been an error at the method level, as in the above example). || | | 200 | The OpenSRF request is returned successfully; the //payload// contains the returned object (however, check the payload, as there may have been an error at the method level, as in the above example). || |
| 404 | [],"debug": "osrfMethodException : Not enough params for method <method name> / service <service name>" | Check the method's parameters; if the correct parameters are being passed, verify that //param// is spelled correctly in the URL.| | | 404 | [],"debug": "osrfMethodException : Not enough params for method <method name> / service <service name>" | Check the method's parameters; if the correct parameters are being passed, verify that //param// is spelled correctly in the URL.| |
| 404 | [],"debug": "osrfMethodException : Method [<method name>] not found for <service name>" | Check the method name against the method's osrf registration, and verify that the //service// parameter points to the correct service. | | | 404 | [],"debug": "osrfMethodException : Method [<method name>] not found for <service name>" | Check the method name against the method's osrf registration, and verify that the //service// parameter points to the correct service. | |
| 404 | [],"debug": "osrfMethodException : An unknown server error occurred" | Verify that //input_type// is not "xml". | | | 404 | [],"debug": "osrfMethodException : An unknown server error occurred" | Verify that //input_type// is not "xml". | |
| 404 (Apache Error) | "The requested URL /osrf-gateway-v1 was not found on this server." | Check that //method// and //service// are spelled correctly | | | 404 (Apache Error) | "The requested URL /osrf-gateway-v1 was not found on this server." | Check that //method// and //service// are spelled correctly | |
| |