Rest - Contacts - Participants - Notes: Difference between revisions

From Views API Documentation
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 4: Line 4:


===Base URL===
===Base URL===
http://app.views.coop/api/restful/contacts/participants/<id>/notes
<nowiki>http://app.views.coop/api/restful/contacts/participants/<id>/notes</nowiki>


==Creating Notes==
==Creating Notes==
Line 35: Line 35:


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


The XML should be in the same format as the create, as specified by the schema
The XML should be in the same format as the create, as specified by the schema
Line 42: Line 42:
''Please note'' You can only update participant notes via this api. For attendance and session notes, you should use the appropriate API.
''Please note'' You can only update participant notes via this api. For attendance and session notes, you should use the appropriate API.
  curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X DELETE
  curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X DELETE
* id - The ID of the session
* id - The ID of the note


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

Revision as of 12:35, 5 July 2012

Purpose

Used for creating, editing and deleting notes against a participant in the Views system.

Base URL

http://app.views.coop/api/restful/contacts/participants/<id>/notes

Creating Notes

curl --url <Base URL> -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.

Searching for a Note

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

This will list all notes against a participnat. you can append one of the following to limit the list:

  • /contact - Participant only notes
  • /attendance - Participant attendance notes
  • /session - Notes on sessions that the participant is registered against

By default ALL notes from the 3 categories are returned.

Fetching a Notes

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

This method will only fetch Participant notes. If you attempt to fetch a note that is either of type attendance or session, you will receive a 303 response directing you to the actual location of that note.


Updating a Note

Please note You can only update participant notes via this api. For attendance and session notes, you should use the appropriate API.

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

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

Deleting a Note

Please note You can only update participant notes via this api. For attendance and session notes, you should use the appropriate API.

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

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