Rest - Work - Venues: Difference between revisions

From Views API Documentation
Jump to navigation Jump to search
(Created page with "==Purpose== Used for creating, editing and deleting Venues from the Views system. ===Base URL=== http://app.views.coop/api/restful/work/venues ==Creating a venues== ''As w...")
 
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:


===Base URL===
===Base URL===
http://app.views.coop/api/restful/work/venues
https://app.viewsapp.net/api/restful/work/venues
 
===Schema===
<nowiki>https://app.viewsapp.net/api/restful/work/venues/schema(.xml|.json|.xsd)</nowiki>


==Creating a venues==
==Creating a venues==
''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/contacts/venues/schema''''(.xml|.json|.xsd)''


Once you have created your data file, you can send it using the following:
Once you have created your data file, you can send it using the following:
Line 26: Line 25:
  curl --url <Base URL>/search?q=<query> -u<username>:<password> -H Content-Type:text/xml  
  curl --url <Base URL>/search?q=<query> -u<username>:<password> -H Content-Type:text/xml  
* query - This is a text string to use to search for in the venues records
* query - This is a text string to use to search for in the venues records
You can search for any field for a specific value by setting the field as a parameter. Please refer to the schema for field names.
There are also a series of fields that you use -from and -to modifiers to express a range:
* Created - yyyy-mm-dd
* Updated - yyyy-mm-dd
* Archived - yyyy-mm-dd


==Updating a venues==
==Updating a venues==
Line 34: Line 41:


==Archiving a venues==
==Archiving a venues==
  curl --url <Base URL>/<id> -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<status>1</status>'
  curl --url <Base URL>/<id>/archive -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<status>1</status>'
* id - The ID of the venues
* id - The ID of the venues


This will set the archive flag on a venues. If you set the status to 0, then it will remove the archive flag.
This will set the archive flag on a venues. If you set the status to 0, then it will remove the archive flag.


==Deleting a venues==
==Deleting a venues==
Line 44: Line 50:
* id - The ID of the venues
* id - The ID of the venues


This should be used with great care as it will permenently delet a venues record.
This should be used with great care as it will permenently delete a venues record.

Latest revision as of 13:03, 26 February 2016

Purpose

Used for creating, editing and deleting Venues from the Views system.

Base URL

https://app.viewsapp.net/api/restful/work/venues

Schema

https://app.viewsapp.net/api/restful/work/venues/schema(.xml|.json|.xsd)

Creating a venues

Once you have created your data file, you can send it using the following:

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.

Fetching a venue

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

Searching for a venues

curl --url <Base URL>/search?q=<query> -u<username>:<password> -H Content-Type:text/xml 
  • query - This is a text string to use to search for in the venues records

You can search for any field for a specific value by setting the field as a parameter. Please refer to the schema for field names.

There are also a series of fields that you use -from and -to modifiers to express a range:

  • Created - yyyy-mm-dd
  • Updated - yyyy-mm-dd
  • Archived - yyyy-mm-dd


Updating a venues

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

The XML should be in the same format as the create XML.

Archiving a venues

curl --url <Base URL>/<id>/archive -u<username>:<password> -H Content-Type:text/xml -X PUT -d '<status>1</status>'
  • id - The ID of the venues

This will set the archive flag on a venues. If you set the status to 0, then it will remove the archive flag.

Deleting a venues

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

This should be used with great care as it will permenently delete a venues record.