Rest - Admin - Value Lists: Difference between revisions
Jump to navigation
Jump to search
m (→Purpose) |
|||
Line 44: | Line 44: | ||
This will return an xml file similar to the following: | This will return an xml file similar to the following: | ||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<valuelist id="42"> | <valuelist id="42" count="4" archived-items="2"> | ||
<items> | <items> | ||
<item id="7">Red</item> | <item id="7">Red</item> | ||
Line 53: | Line 53: | ||
</valuelist> | </valuelist> | ||
==Returning Archived Values== | |||
If an additional parameter '''include-archived=1''' is passed then the following would be output: | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<valuelist id="42" count="6" archived-items="2"> | |||
<items> | |||
<item id="7">Red</item> | |||
<item id="18">Green</item> | |||
<item id="19">Blue</item> | |||
<item id="25">Purple</item> | |||
<item id="26" archived="true">Orange</item> | |||
<item id="27" archived="true">White</item> | |||
</items> | |||
</valuelist> | |||
==Fetching a Value List By Name== | ==Fetching a Value List By Name== |
Latest revision as of 06:59, 21 September 2020
Purpose
Used for maintaining the value lists within Views.
Base URL
https://app.viewsapp.net/api/restful/admin/valuelists
Retrieve a list of available value lists
curl --url <Base URL>?type=<type>&mode=<mode> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>"
- type required - This must be one of the following values:
- Staff
- Volunteer
- Individual
- Person
- Group
- Session
- SessionGroup
- Question
- Agency
- Venue
- QualificationProgress
- QualificationAchievement
- AddressBook
- Report
- mode - this can be left blank to return a complete list, or one of the following values:
- editable - filters the returned value lists that are allowed to be extended
- nonsystem - filters the returned value lists to only Non System lists
Retreive the details of a Value List
curl --url <Base URL>/<id>/details -u<username>:<password> -H Content-Type:text/xml
- id - The ID of the Value List
This will return all the meta data about a Value list. Needs more detail
Fetching a Value List
curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml
- id - The ID of the Value List
This will return an xml file similar to the following:
<?xml version="1.0" encoding="utf-8"?> <valuelist id="42" count="4" archived-items="2"> <items> <item id="7">Red</item> <item id="18">Green</item> <item id="19">Blue</item> <item id="25">Purple</item> </items> </valuelist>
Returning Archived Values
If an additional parameter include-archived=1 is passed then the following would be output:
<?xml version="1.0" encoding="utf-8"?> <valuelist id="42" count="6" archived-items="2"> <items> <item id="7">Red</item> <item id="18">Green</item> <item id="19">Blue</item> <item id="25">Purple</item> <item id="26" archived="true">Orange</item> <item id="27" archived="true">White</item> </items> </valuelist>
Fetching a Value List By Name
curl --url <Base URL>/<type>/<name> -u<username>:<password> -H Content-Type:text/xml
- type - This is the type of the Value List. This must be one of the values stated above
- name - The name of the Value List
This will return an xml file in the same format as fetching a list by id
For eaxample, the following call will get a list of session group volunteering types:
curl --url <Base URL>/sessiongroup/volunteeringtypes -u<username>:<password> -H Content-Type:text/xml