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...") |
No edit summary |
||
Line 6: | Line 6: | ||
===Base URL=== | ===Base URL=== | ||
http://app.views.coop/api/restful/admin/programmefields | http://app.views.coop/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> |
Revision as of 10:19, 15 February 2013
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. This can be achieved via this API
Base URL
http://app.views.coop/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>