Rest - Admin - ProgrammeFields
Jump to navigation
Jump to search
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