CRM-2 Tags API

From Opentaps Wiki
Revision as of 22:03, 6 October 2014 by Sichen (talk | contribs) (Relating Tags to Tasks and Activities)
Jump to navigationJump to search

Tags

A tag can store the following data:

  • tagId - unique identifier
  • tag name - descriptive text of the tag
  • an optional URL link which can be used to link to an outside system, such as the order ID or party ID of a legacy ERP or CRM system.
  • keywords which can be used for searching similar documents

Tag names are case insensitive, so the tags opentaps, OPENTAPs, and OpenTaps would all be considered the same.

API

Endpoint: https://crm2.opentaps.com/tag

POST: Create a new tag

Parameters:

  • clientDomain
  • authToken
  • tagName
  • tagUrl
  • tagKeywords

Returns

  • tagId: unique identifier of your tag

If the same tagName (case insensitive) already exists, then the operation would return an error.

PUT: Update an existing tag using the unique tagId

Parameters:

  • clientDomain
  • authToken
  • tagId

DELETE: Delete an existing tag using the unique tagId

Parameters:

  • clientDomain
  • authToken
  • tagId

GET: Search for existing tags which contain your tag name (case insensitive)

Parameters:

  • clientDomain
  • authToken
  • tagName

Returns

  • List of tags, including tagId, tagName, tagUrl, tagKeywords for each tag
Relating Tags to Tasks and Activities

A tag can be added to any task or activity.

If you append the fields tagName, tagUrl, tagKeywords to any POST API call to create an activity or task, crm2 will check if the tagName already exists. If so, the activity or task will be associated with your tag. In that case, the URL and keywords will be ignored. If the tag name is not found, it will automatically create a new tag with the name, URL, and keywords and associate it with your task or activity.

You can get all the activities and tasks related to a tag with the API call to https://crm2.opentaps.com/tagActivities

GET: Get all activities and tasks related to a task

Parameters:

  • clientDomain
  • authToken
  • tagId

Returns

  • List of activities and tasks related to the tag