Difference between revisions of "CRM-2 Activities API"

From Opentaps Wiki
Jump to navigationJump to search
(Activities API allows to perform operations on activities.)
(GET: Retrieve activities)
Line 16: Line 16:
 
* clientDomain - Customer's client domain.
 
* clientDomain - Customer's client domain.
  
Return JSON. Sample of output
+
Return JSON.
  "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 ===
 
=== DELETE: Delete an activity ===

Revision as of 00:12, 20 April 2013

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.

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.