Difference between revisions of "CRM-2 API"
From Opentaps Wiki
Jump to navigationJump to searchLine 14: | Line 14: | ||
<pre> | <pre> | ||
$ curl -X POST 'http://localhost:8078/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" | $ curl -X POST 'http://localhost:8078/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" | ||
− | -d authToken= | + | -d authToken=<token> |
$ curl -X GET "http://localhost:8078/admin/activity-type?clientDomain=newdomain.com | $ curl -X GET "http://localhost:8078/admin/activity-type?clientDomain=newdomain.com | ||
− | &authToken= | + | &authToken=<token>" |
+ | $ curl -X DELETE 'http://localhost:8078/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token> | ||
</pre> | </pre> | ||
Revision as of 18:47, 31 July 2013
CRM-2 API is accessed via RESTful services using your authorization token key. All access to CRM-2 API follow this common pattern:
- URL: RESTful URL of the CRM-2 resource
- operation:
- POST: creates new value
- GET: get existing value(s)
- PUT: update existing value
- DELETE: delete existing value
- clientDomain: name of your domain, ie xyz.com
- authToken: your access token key, a very long alphanumeric string
- parameters: key value pairs for your API operation
You can also use curl or a visual RESTful client to test the API. For example,
$ curl -X POST 'http://localhost:8078/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token> $ curl -X GET "http://localhost:8078/admin/activity-type?clientDomain=newdomain.com &authToken=<token>" $ curl -X DELETE 'http://localhost:8078/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token>
will add a new email to be polled by crm-2
API available, grouped by section, are: