Difference between revisions of "CRM-2 Activities API"
From Opentaps Wiki
Jump to navigationJump to search (→Activities API allows to perform operations on activities.) |
|||
Line 7: | Line 7: | ||
=== GET: Retrieve activities === | === GET: Retrieve activities === | ||
Use pattern /{numberOfActivities}/{startFrom} | Use pattern /{numberOfActivities}/{startFrom} | ||
+ | |||
+ | Attributes: | ||
* numberOfActivities - number of activities to return. | * numberOfActivities - number of activities to return. | ||
* startFrom(optional) - return activities starting from specified sequence number. W/o this attribute service returns all activites. | * startFrom(optional) - return activities starting from specified sequence number. W/o this attribute service returns all activites. | ||
+ | |||
+ | Parameters: | ||
+ | * authToken - OAuth access token. | ||
+ | * clientDomain - Customer's client domain. | ||
Return JSON. Sample of output | Return JSON. Sample of output | ||
Line 41: | Line 47: | ||
=== DELETE: Delete an activity === | === DELETE: Delete an activity === | ||
Use pattern /{activityId} | Use pattern /{activityId} | ||
+ | |||
+ | Attributes: | ||
* activityId - An activity identifier. | * activityId - An activity identifier. | ||
+ | |||
+ | Parameters: | ||
+ | * authToken - OAuth access token. | ||
=== POST: Create or update activity === | === POST: Create or update activity === | ||
There is no special pattern. Post request to /activities. | There is no special pattern. Post request to /activities. | ||
+ | |||
+ | Parameters: | ||
+ | * authToken - OAuth access token. | ||
+ | * clientDomain - Customer's client domain. | ||
+ | * Fields of activity, attributes should be prefixed with "note_field_"; | ||
=== POST: Associate a contact with an activity in a role. === | === POST: Associate a contact with an activity in a role. === | ||
Line 50: | Line 66: | ||
Parameters: | Parameters: | ||
+ | * authToken - OAuth access token. | ||
+ | * clientDomain - Customer's client domain. | ||
* activityId - An activity identifier. | * activityId - An activity identifier. | ||
* contactId - A contact id. | * contactId - A contact id. | ||
Line 58: | Line 76: | ||
Parameters: | Parameters: | ||
+ | * authToken - OAuth access token. | ||
+ | * clientDomain - Customer's client domain. | ||
* activityId - An activity identifier. | * activityId - An activity identifier. | ||
* contactId - A contact id. | * contactId - A contact id. | ||
* role(optional) - A role, an arbitrary string. | * role(optional) - A role, an arbitrary string. |
Revision as of 15:21, 19 April 2013
Contents
Activities API allows to perform operations on activities.
The API calls should be prefixed with URL http://crm-2-url/activities.
Available operations are:
GET: Retrieve activities
Use pattern /{numberOfActivities}/{startFrom}
Attributes:
- numberOfActivities - number of activities to return.
- startFrom(optional) - return activities starting from specified sequence number. W/o this attribute service returns all activites.
Parameters:
- authToken - OAuth access token.
- clientDomain - Customer's client domain.
Return JSON. Sample of output
"result":{ "resultValue":[ {"note":{ "noteId":"50aa76c9e4b06daa4f6041c7", "noteText":"Dransfield and Ross - laundry totes", "sequenceNum":1, "clientDomain":"client.domain.com", "dateTimeCreated":"2012-11-19 20:13:29.501", "createdByUser":{ "photo":"http://.../avatars/30.jpg", "name":"...", "userType":"...", "userInfoUrl":"http://.../", "id":"m2ka" }, "note_field_activityType":"PINNED", "note_field_boardName":"graciousstyle.com", ... "note_field_referenceUrl":"http://www.graciousstyle.com/shop/laundry-totes","note_field_status":"COMPLETED" } }, {"note":{ "noteId":"50aa76cbe4b06daa4f6041c8", ... } }
DELETE: Delete an activity
Use pattern /{activityId}
Attributes:
- activityId - An activity identifier.
Parameters:
- authToken - OAuth access token.
POST: Create or update activity
There is no special pattern. Post request to /activities.
Parameters:
- authToken - OAuth access token.
- clientDomain - Customer's client domain.
- Fields of activity, attributes should be prefixed with "note_field_";
POST: Associate a contact with an activity in a role.
Use pattern /contact/add
Parameters:
- authToken - OAuth access token.
- clientDomain - Customer's client domain.
- activityId - An activity identifier.
- contactId - A contact id.
- role(optional) - A role, an arbitrary string.
POST: Remove contact association.
Use pattern /contact/remove
Parameters:
- authToken - OAuth access token.
- clientDomain - Customer's client domain.
- activityId - An activity identifier.
- contactId - A contact id.
- role(optional) - A role, an arbitrary string.