Rest - Admin - Flatpack: Difference between revisions
(Created page with "==Purpose== To automate and retrieve flatpack archives from views ===Base URL=== http://app.views.coop/api/restful/admin/flatpack ==Listing available Flatpacks== curl --ur...") |
m (→Base URL) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
===Base URL=== | ===Base URL=== | ||
https://app.viewsapp.net/api/restful/admin/flatpack | |||
==Get a list of available blocks== | ==Get a list of available blocks== | ||
Line 93: | Line 47: | ||
'''''Note 1:''' The list above may vary from agency to agency'' | '''''Note 1:''' The list above may vary from agency to agency'' | ||
'''''Note 2:''' The id's in the resulting XML data are irrelevant and can be ignored'' | '''''Note 2:''' The id's in the resulting XML data are irrelevant and can be ignored'' | ||
==Generate a Flatpack== | |||
curl --url <Base URL>/<file> -u<username>:<password> -XPOST [--data "<xml>"] | |||
This will generate a new flatpack, if one does not already exist. If not data is posted to the API, the the flatpack is generated with all the available blocks. | |||
To restrict the data within the flatpack archive, you should pass a list of blocks you want: | |||
<flatpackblocks> | |||
<flatpackblock>personTypePerson</flatpackblock> | |||
<flatpackblock>personTypeStaff</flatpackblock> | |||
<flatpackblock>personTypeVolunteer</flatpackblock> | |||
<flatpackblock>personTypeProfessional</flatpackblock> | |||
<flatpackblock>sessionAttendance</flatpackblock> | |||
</flatpackblocks> | |||
==Listing available Flatpacks== | |||
curl --url <Base URL>/list(.json|xml) -u<username>:<password> | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<admin> | |||
<flatpacks> | |||
<flatpack id="0"> | |||
<file>flatpack20160113.zip</file> | |||
<date>13/01/2016</date> | |||
<size>1100021</size> | |||
<sha1sum>2b77ba54249c7a25f4a05be2b9a7c28a5fe9071f</sha1sum> | |||
</flatpack> | |||
<flatpack id="1"> | |||
<file>flatpack20160112.zip</file> | |||
<date>2016-01-12</date> | |||
<size>1099668</size> | |||
<sha1sum>68eac14b20480b9e77f599b8685307153e3f43db</sha1sum> | |||
</flatpack> | |||
</flatpacks> | |||
</admin> | |||
'''''Note:''' The id's in the resulting XML data are irrelevant and can be ignored'' | |||
==Downloading a Flatpack== | |||
curl --url <Base URL>/<file> -u<username>:<password> | |||
This will download a the flatpack zip file requested. | |||
==Deleting Flatpacks / House keeping== | |||
This is currently not implemented. Please contact us if you need this |
Latest revision as of 13:12, 26 February 2016
Purpose
To automate and retrieve flatpack archives from views
Base URL
https://app.viewsapp.net/api/restful/admin/flatpack
Get a list of available blocks
curl --url <Base URL>/getblocks(.json|xml) -u<username>:<password>
These are the objects can be packed into a flatpack. By default all available data is stored within the flatpack
<?xml version="1.0" encoding="UTF-8"?> <admin> <flatpackblocks> <flatpackblock id="0">reports</flatpackblock> <flatpackblock id="1">agencyProject</flatpackblock> <flatpackblock id="2">caseStudies</flatpackblock> <flatpackblock id="3">finance</flatpackblock> <flatpackblock id="4">group</flatpackblock> <flatpackblock id="5">media</flatpackblock> <flatpackblock id="6">note</flatpackblock> <flatpackblock id="7">objectives</flatpackblock> <flatpackblock id="8">outcomes</flatpackblock> <flatpackblock id="9">personCondition</flatpackblock> <flatpackblock id="10">personContact</flatpackblock> <flatpackblock id="11">personQualifications</flatpackblock> <flatpackblock id="12">personRestriction</flatpackblock> <flatpackblock id="13">questionnaireAnswers</flatpackblock> <flatpackblock id="14">questionnaire</flatpackblock> <flatpackblock id="15">questionsData</flatpackblock> <flatpackblock id="16">reportsPublished</flatpackblock> <flatpackblock id="17">session</flatpackblock> <flatpackblock id="18">sessionGroup</flatpackblock> <flatpackblock id="19">sessionStaffAttendance</flatpackblock> <flatpackblock id="20">stock</flatpackblock> <flatpackblock id="21">stockCategory</flatpackblock> <flatpackblock id="22">stockLoan</flatpackblock> <flatpackblock id="23">venue</flatpackblock> <flatpackblock id="24">personTypePerson</flatpackblock> <flatpackblock id="25">personTypeStaff</flatpackblock> <flatpackblock id="26">personTypeVolunteer</flatpackblock> <flatpackblock id="27">personTypeProfessional</flatpackblock> <flatpackblock id="28">sessionAttendance</flatpackblock> </flatpackblocks> </admin>
Note 1: The list above may vary from agency to agency
Note 2: The id's in the resulting XML data are irrelevant and can be ignored
Generate a Flatpack
curl --url <Base URL>/<file> -u<username>:<password> -XPOST [--data "<xml>"]
This will generate a new flatpack, if one does not already exist. If not data is posted to the API, the the flatpack is generated with all the available blocks. To restrict the data within the flatpack archive, you should pass a list of blocks you want:
<flatpackblocks> <flatpackblock>personTypePerson</flatpackblock> <flatpackblock>personTypeStaff</flatpackblock> <flatpackblock>personTypeVolunteer</flatpackblock> <flatpackblock>personTypeProfessional</flatpackblock> <flatpackblock>sessionAttendance</flatpackblock> </flatpackblocks>
Listing available Flatpacks
curl --url <Base URL>/list(.json|xml) -u<username>:<password>
<?xml version="1.0" encoding="UTF-8"?> <admin> <flatpacks> <flatpack id="0"> <file>flatpack20160113.zip</file> <date>13/01/2016</date> <size>1100021</size> <sha1sum>2b77ba54249c7a25f4a05be2b9a7c28a5fe9071f</sha1sum> </flatpack> <flatpack id="1"> <file>flatpack20160112.zip</file> <date>2016-01-12</date> <size>1099668</size> <sha1sum>68eac14b20480b9e77f599b8685307153e3f43db</sha1sum> </flatpack> </flatpacks> </admin>
Note: The id's in the resulting XML data are irrelevant and can be ignored
Downloading a Flatpack
curl --url <Base URL>/<file> -u<username>:<password>
This will download a the flatpack zip file requested.
Deleting Flatpacks / House keeping
This is currently not implemented. Please contact us if you need this