Difference between revisions of "CRM-2 API"
From Opentaps Wiki
Jump to navigationJump to searchm (Protected "CRM-2 API": Sysop page [edit=sysop:move=sysop]) |
|||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
CRM-2 API is accessed via RESTful services using your authorization token key. All access to CRM-2 API follow this common pattern: | 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, | You can also use curl or a visual RESTful client to test the API. For example, | ||
− | + | <pre> | |
− | $ curl | + | $ curl -X POST 'http://crm-2-url/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" |
− | + | -d authToken=<token> | |
+ | $ curl -X GET "http://crm-2-url/admin/activity-type?clientDomain=newdomain.com | ||
+ | &authToken=<token>" | ||
+ | $ curl -X DELETE 'http://crm-2-url/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token> | ||
+ | </pre> | ||
+ | |||
+ | can be used to create, read, and delete data. | ||
+ | |||
+ | To update data, a PUT operation is used | ||
+ | |||
+ | <pre> | ||
+ | $ curl -X PUT --data "clientDomain=xyz.com&mailUser=newemail@gmail.com&mailStoreProtocol="imaps"& | ||
+ | mailHost="pop.googlemail.com"&mailPass="123456" | ||
+ | &authToken=<token>" | ||
+ | http://crm-2-url/admin/email-to-poll | ||
+ | </pre> | ||
API available, grouped by section, are: | API available, grouped by section, are: | ||
− | + | * [[CRM-2 Security Model]] | |
− | + | * [[CRM-2 Administrative API]] | |
− | + | * [[CRM-2 Contacts API]] | |
+ | * [[CRM-2 Activities API]] | ||
+ | * [[CRM-2 Tags API]] | ||
+ | * [[CRM-2 Social API]] |
Latest revision as of 00:20, 20 March 2015
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://crm-2-url/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token> $ curl -X GET "http://crm-2-url/admin/activity-type?clientDomain=newdomain.com &authToken=<token>" $ curl -X DELETE 'http://crm-2-url/admin/activity-type' -d clientDomain=newdomain.com -d activityType="PINNED" -d authToken=<token>
can be used to create, read, and delete data.
To update data, a PUT operation is used
$ curl -X PUT --data "clientDomain=xyz.com&mailUser=newemail@gmail.com&mailStoreProtocol="imaps"& mailHost="pop.googlemail.com"&mailPass="123456" &authToken=<token>" http://crm-2-url/admin/email-to-poll
API available, grouped by section, are: