Rest - Admin - ProgrammeFields: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==Purpose== When interacting with Views accounts, it is sometimes necessary to identify specific fields that belong to a common Programme. For example a Disability field. Thi...") |
m (→Base URL) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
When interacting with Views accounts, it is sometimes necessary to identify | When interacting with Views accounts, it is sometimes necessary to identify a field that is derieved from a program, and implemented in all agencies within that program. For example a Disability field. This can be achieved via this API | ||
===Base URL=== | ===Base URL=== | ||
https://app.viewsapp.net/api/restful/admin/programmefields | |||
==Identify a programme field== | |||
curl --url <Base URL>/<structure>/<fieldname> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>" | |||
This will return a list of programme fields for the given field, for the programmes that the agency is associated with in the following format: | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<programmefields> | |||
<programmefield progid="18" sourceid="21"> | |||
<id>51</id> | |||
<SourceID>21</SourceID> | |||
<fieldName>Disability_P_51</fieldName> | |||
<fieldLoc>f</fieldLoc> | |||
<fieldType>text</fieldType> | |||
<inputType>select | |||
</inputType> | |||
<validation> | |||
</validation> | |||
<valueListID>140</valueListID> | |||
<tagline></tagline> | |||
<category>Demographic</category> | |||
<displayName>Disability</displayName> | |||
<flags>255</flags> | |||
<enabled>1</enabled> | |||
<value></value> | |||
</programmefield> | |||
<programmefield progid="19" sourceid="40"> | |||
<id>80</id> | |||
<SourceID>40</SourceID> | |||
<fieldName>Disability_P_80</fieldName> | |||
<fieldLoc>f</fieldLoc> | |||
<fieldType>text</fieldType> | |||
<inputType>select</inputType> | |||
<validation></validation> | |||
<valueListID>154</valueListID> | |||
<tagline></tagline> | |||
<category>Demographic</category> | |||
<displayName>Disability</displayName> | |||
<flags>993</flags> | |||
<enabled>1</enabled> | |||
<value></value> | |||
</programmefield> | |||
</programmefields> | |||
This shows there are 2 Disability fields, one for each Programme. | |||
==Identify a programme field for a specific programme== | |||
If you are only interested in knowing what a field is for a given programme, then you should use the following: | |||
curl --url <Base URL>/<structure>/<fieldname>/<ProgID> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>" | |||
Which will return: | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<programmefields> | |||
<programmefield progid="18" sourceid="21"> | |||
<id>51</id> | |||
<SourceID>21</SourceID> | |||
<fieldName>Disability_P_51</fieldName> | |||
<fieldLoc>f</fieldLoc> | |||
<fieldType>text</fieldType> | |||
<inputType>select | |||
</inputType> | |||
<validation> | |||
</validation> | |||
<valueListID>140</valueListID> | |||
<tagline></tagline> | |||
<category>Demographic</category> | |||
<displayName>Disability</displayName> | |||
<flags>255</flags> | |||
<enabled>1</enabled> | |||
<value></value> | |||
</programmefield> | |||
</programmefields> | |||
== Supported Structures == | |||
* Group | |||
* Staff | |||
* Volunteer | |||
* Person | |||
* SessionGroup | |||
* Session | |||
* Venue | |||
* Field | |||
* Media | |||
* PersonContact | |||
* CaseStudy |
Latest revision as of 13:10, 26 February 2016
Purpose
When interacting with Views accounts, it is sometimes necessary to identify a field that is derieved from a program, and implemented in all agencies within that program. For example a Disability field. This can be achieved via this API
Base URL
https://app.viewsapp.net/api/restful/admin/programmefields
Identify a programme field
curl --url <Base URL>/<structure>/<fieldname> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>"
This will return a list of programme fields for the given field, for the programmes that the agency is associated with in the following format:
<?xml version="1.0" encoding="utf-8"?> <programmefields> <programmefield progid="18" sourceid="21"> <id>51</id> <SourceID>21</SourceID> <fieldName>Disability_P_51</fieldName> <fieldLoc>f</fieldLoc> <fieldType>text</fieldType> <inputType>select </inputType> <validation> </validation> <valueListID>140</valueListID> <tagline></tagline> <category>Demographic</category> <displayName>Disability</displayName> <flags>255</flags> <enabled>1</enabled> <value></value> </programmefield> <programmefield progid="19" sourceid="40"> <id>80</id> <SourceID>40</SourceID> <fieldName>Disability_P_80</fieldName> <fieldLoc>f</fieldLoc> <fieldType>text</fieldType> <inputType>select</inputType> <validation></validation> <valueListID>154</valueListID> <tagline></tagline> <category>Demographic</category> <displayName>Disability</displayName> <flags>993</flags> <enabled>1</enabled> <value></value> </programmefield> </programmefields>
This shows there are 2 Disability fields, one for each Programme.
Identify a programme field for a specific programme
If you are only interested in knowing what a field is for a given programme, then you should use the following:
curl --url <Base URL>/<structure>/<fieldname>/<ProgID> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>"
Which will return:
<?xml version="1.0" encoding="utf-8"?> <programmefields> <programmefield progid="18" sourceid="21"> <id>51</id> <SourceID>21</SourceID> <fieldName>Disability_P_51</fieldName> <fieldLoc>f</fieldLoc> <fieldType>text</fieldType> <inputType>select </inputType> <validation> </validation> <valueListID>140</valueListID> <tagline></tagline> <category>Demographic</category> <displayName>Disability</displayName> <flags>255</flags> <enabled>1</enabled> <value></value> </programmefield> </programmefields>
Supported Structures
- Group
- Staff
- Volunteer
- Person
- SessionGroup
- Session
- Venue
- Field
- Media
- PersonContact
- CaseStudy