Rest - Work - Session Groups - Sessions: Difference between revisions

From Views API Documentation
Jump to navigation Jump to search
(Created page with "==Purpose== Used for creating, editing and deleting group sessions in the Views system. ''As with all our services, the data structure can vary from account to account, depe...")
 
Line 5: Line 5:
''As with all our services, the data structure can vary from account to account, depending how you have configured your system.  
''As with all our services, the data structure can vary from account to account, depending how you have configured your system.  
To get the expected schema for the data you need to supply, you should download the schema information from:  
To get the expected schema for the data you need to supply, you should download the schema information from:  
http://app.views.coop/api/restful/contacts/sessiongroups/schema''(.xml|.json|.xsd)''
http://app.views.coop/api/restful/work/sessiongroups/schema''(.xml|.json|.xsd)''


===Base URL===
===Base URL===

Revision as of 15:37, 9 May 2012

Purpose

Used for creating, editing and deleting group sessions in the Views system.

As with all our services, the data structure can vary from account to account, depending how you have configured your system. To get the expected schema for the data you need to supply, you should download the schema information from: http://app.views.coop/api/restful/work/sessiongroups/schema(.xml|.json|.xsd)

Base URL

http://app.views.coop/api/restful/work/sessiongroups/sessions

Creating Sessions

To create a new session, you must do this via the session group API. This is because sessions must be created under a session group.

curl --url http://app.views.coop/api/restful/work/sessiongroups/<id>/sessions -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>"

If there is a problem with creating that record, you will get a response containing all the errors, plus a copy of the translated data you supplied.

If the record was created successfully, the service will return a complete reocrd for the newly created record if the attribute id set as the newly created id.

Fetching a Session

curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml

Updating a Session

curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d "<xml>"
  • id - The ID of the session

The XML should be in the same format as the create, as specified by the schema

Deleting a session

curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X DELETE
  • id - The ID of the session

This should be used with great care as it will permanently delete a session groups record.