Rest - Contacts - Participants - Associations

From Views API Documentation
Jump to navigation Jump to search

Purpose

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

Base URL

https://app.viewsapp.net/api/restful/contacts/participants/<id>/associations

Creating Associations

Please note All parameters with * are required.

curl --url <Base URL> -u<username>:<password> -H Content-Type:text/xml -X POST -d "<xml>"
  • associationType* - The association contact type
  • associationId* - The association contactID
  • association* - The association
  • description - The association description
  • validityFrom - The association validity start date
  • validityTo - The association validity end date

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 Associations

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

This will list all associations against a participant. You can append one of the following to limit the list:

  • associationType - The association contact type
  • q - The search value can contain text or date in d/m/Y format [the results will be filtered by Association, Description, StartDate and EndDate columns]

By default ALL participant associations are returned.

Fetching an Association

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

This method will only fetch Participant association.

Updating an Association

curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d "<xml>"
  • id - The ID of the association
  • association - The association
  • description - The association description
  • validityFrom - The association validity start date
  • validityTo - The association validity end date

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

Deleting an Association

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

This should be used with great care as it will permanently delete the association record.