Views API Documentation: Difference between revisions
mNo edit summary |
|||
(48 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Rest== | |||
===General Overview=== | |||
All of our REST services are available in both XML and JSON formats, unless otherwise stated. The default format is XML. For the purposes of this documentation we only document the XML method. If you want to interact using json, then you should either make sure you request using <code>Content-Type: application/json</code>, alternatively you have append the extension <code>.json</code> to the URI e.g: | |||
curl --url <Base URL>/<id> -u<username>:<password> -H Accept:application/json | |||
''' | or | ||
* Contacts | |||
** [[SOAP - Contacts - Particpants|Particpants]] | curl --url <Base URL>/<id>.json -u<username>:<password> | ||
====Using OAuth2==== | |||
The use of OAthu2 access_tokens can be used. To do this, you must first request an <code>access_token</code> from the authentication portal https://authport.viewsapp.net/. This can be done in the following way (using Google Apps Script: | |||
<pre> | |||
// Get access_token | |||
var response = UrlFetchApp.fetch('https://authportal.viewsapp.net/token.php', { | |||
'method' : 'post', | |||
'payload' : {'grant_type': 'password', 'username' : 'my_username', 'password' : 'my_password'}, | |||
'headers' : {"Authorization": "Basic " + Utilities.base64Encode('my_username' + ":" + 'my_password')} | |||
}); | |||
var access_token = JSON.parse(response.getContentText()).access_token; | |||
</pre> | |||
You would then pass the following fields along side any request: | |||
* client_id=<username> | |||
* access_token=<access_token> | |||
via curl: | |||
<pre>curl --url https://authportal.viewsapp.net/token.php -X POST -d "grant_type=password" -u<username>:<password> -H Accept:application/json</pre> | |||
====Searching the API's==== | |||
A lot of the API's have a search capabilities and share some parameters: | |||
* q=<string> - This is a free text field for basic searching | |||
* pageFold=<int> - This the number of results to return in any result set | |||
* offset=<int> - This is how many records to offset in the result set | |||
* page=<int> - This can be used in place of offset as is just makes an adjustment to the offset value using the following fomula: <code>offset = (page-1)*pageFold</code>. | |||
** ''If used in conjunction with offset, then each page is offset by the specified values also.'' | |||
** By default this equals 1. | |||
* archived - By default, only non-archived results are returned. Setting this parameter to 1 result in searching archived records | |||
===Contacts=== | |||
* [[Rest - Contacts - Participants|Particpants]] | |||
** [[Rest - Contacts - Participants - Sessions|Session Attendance]] | |||
** [[Rest - Contacts - Participants - Notes|Notes]] | |||
** [[Rest - Contacts - Participants - Address Book|Address Book]] | |||
** [[Rest - Contacts - Participants - Questionnaires|Questionnaires]] | |||
** [[Rest - Contacts - Participants - Volunteering|Volunteering]] | |||
** [[Rest - Contacts - Participants - Conditions|Conditions]] | |||
** [[Rest - Contacts - Participants - Restrictions|Restrictions]] | |||
** [[Rest - Contacts - Participants - Associations|Associations]] | |||
* [[Rest - Contacts - Groups|Groups]] | |||
** [[Rest - Contacts - Groups - Sessions|Session Attendance]] | |||
** [[Rest - Contacts - Groups - Notes|Notes]] | |||
** [[Rest - Contacts - Groups - Address Book|Address Book]] | |||
** [[Rest - Contacts - Groups - Questionnaires|Questionnaires]] | |||
** [[Rest - Contacts - Groups - Associations|Associations]] | |||
* [[Rest - Contacts - Staff|Staff]] | |||
** [[Rest - Contacts - Staff - Sessions|Session Attendance]] | |||
** [[Rest - Contacts - Staff - Notes|Notes]] | |||
** [[Rest - Contacts - Staff - Address Book|Address Book]] | |||
** [[Rest - Contacts - Staff - Questionnaires|Questionnaires]] | |||
** [[Rest - Contacts - Staff - Volunteering|Volunteering]] | |||
** [[Rest - Contacts - Staff - Associations|Associations]] | |||
* [[Rest - Contacts - Professionals|Professionals]] | |||
** [[Rest - Contacts - Professionals - Sessions|Session Attendance]] | |||
** [[Rest - Contacts - Professionals - Notes|Notes]] | |||
** [[Rest - Contacts - Professionals - Questionnaires|Questionnaires]] | |||
** [[Rest - Contacts - Professionals - Associations|Associations]] | |||
* [[Rest - Contacts - Volunteers|Volunteers]] | |||
** [[Rest - Contacts - Volunteers - Sessions|Session Attendance]] | |||
** [[Rest - Contacts - Volunteers - Notes|Notes]] | |||
** [[Rest - Contacts - Volunteers - Address Book|Address Book]] | |||
** [[Rest - Contacts - Volunteers - Questionnaires|Questionnaires]] | |||
** [[Rest - Contacts - Volunteers - Volunteering|Volunteering]] | |||
===Work=== | |||
* [[Rest - Work - Venues|Venues]] | |||
* [[Rest - Work - Session Groups|Session Groups]] | |||
** [[Rest - Work - Session Groups - Participants|Session Group Participants]] | |||
** [[Rest - Work - Session Groups - Sessions|Sessions]] | |||
*** [[Rest - Work - Session Groups - Session Notes|Session Notes]] | |||
*** [[Rest - Work - Session Groups - Session Participants|Session Participants]] | |||
*** [[Rest - Work - Session Groups - Session Staff|Session Staff]] | |||
*** [[Rest - Work - Session Groups - Session Questionnaires|Session Questionnaires]] | |||
* [[Rest - Work - Agency Projects|Agency Projects]] | |||
** [[Rest - Work - Agency Projects - Session Groups|Agency Project Session Groups]] | |||
** [[Rest - Work - Agency Projects - Objectives|Objectives]] | |||
** [[Rest - Work - Agency Projects - Outcomes|Outcomes]] | |||
===Evidence=== | |||
* [[Rest - Evidence - Questionnaires|Questionnaires]] | |||
** [[Rest - Evidence - Questionnaires - Questions|Questions]] | |||
** [[Rest - Evidence - Questionnaires - Answers|Answers]] | |||
===Admin=== | |||
* [[Rest - Admin - Value Lists|Value Lists]] | |||
* [[Rest - Admin - Programmes|Programmes]] | |||
* [[Rest - Admin - Objectives|Objectives]] | |||
* [[Rest - Admin - Outcomes|Outcomes]] | |||
* [[Rest - Admin - ProgrammeFields|Programme Fields]] | |||
* [[Rest - Admin - Change Log|Change Log]] | |||
* [[Rest - Admin - Flatpack|Flatpack]] | |||
==SOAP Documention== | |||
===Contacts=== | |||
* [[SOAP - Contacts - Particpants|Particpants]] | |||
* [[SOAP - Contacts - Staff|Staff]] | |||
===Evidence=== | |||
* [[SOAP - Questionaires|Questionaires]] | * [[SOAP - Questionaires|Questionaires]] | ||
Latest revision as of 09:16, 4 April 2025
Rest
General Overview
All of our REST services are available in both XML and JSON formats, unless otherwise stated. The default format is XML. For the purposes of this documentation we only document the XML method. If you want to interact using json, then you should either make sure you request using Content-Type: application/json
, alternatively you have append the extension .json
to the URI e.g:
curl --url <Base URL>/<id> -u<username>:<password> -H Accept:application/json
or
curl --url <Base URL>/<id>.json -u<username>:<password>
Using OAuth2
The use of OAthu2 access_tokens can be used. To do this, you must first request an access_token
from the authentication portal https://authport.viewsapp.net/. This can be done in the following way (using Google Apps Script:
// Get access_token var response = UrlFetchApp.fetch('https://authportal.viewsapp.net/token.php', { 'method' : 'post', 'payload' : {'grant_type': 'password', 'username' : 'my_username', 'password' : 'my_password'}, 'headers' : {"Authorization": "Basic " + Utilities.base64Encode('my_username' + ":" + 'my_password')} }); var access_token = JSON.parse(response.getContentText()).access_token;
You would then pass the following fields along side any request:
- client_id=<username>
- access_token=<access_token>
via curl:
curl --url https://authportal.viewsapp.net/token.php -X POST -d "grant_type=password" -u<username>:<password> -H Accept:application/json
Searching the API's
A lot of the API's have a search capabilities and share some parameters:
- q=<string> - This is a free text field for basic searching
- pageFold=<int> - This the number of results to return in any result set
- offset=<int> - This is how many records to offset in the result set
- page=<int> - This can be used in place of offset as is just makes an adjustment to the offset value using the following fomula:
offset = (page-1)*pageFold
.- If used in conjunction with offset, then each page is offset by the specified values also.
- By default this equals 1.
- archived - By default, only non-archived results are returned. Setting this parameter to 1 result in searching archived records