Create an event subscription

post

/services/rest/connect/v1.4/eventSubscriptions

Request

Body ()
The event-based subscription management object that allows external applications to discover objects that can be subscribed.
Root Schema : eventSubscriptions
Type: object
The event-based subscription management object that allows external applications to discover objects that can be subscribed.
Show Source
  • Maximum Length: 256
    Pattern: ^(Contact|Organization|Incident)$
    The string which represents the type of object in the ObjectShapeXML.
  • The date and time when the event subscription was created. This attribute is read-only.
  • Maximum Length: 1333
    The URL to post the notification event. Note: If an endpoint is registered as a callback, it should contain the fully qualified domain name. For example: "endpoint" : "https://mydomain-name.com:[port-number]/myEventReceiverService"
  • namedIDs-eventSubscriptions-eventType
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • Minimum Value: 1
    Maximum Value: 9223372036854776000
    The unique identifier of the event subscription.
  • namedIDs-eventSubscriptions-integrationUser
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • Maximum Length: 255
    The name used to look up the event subscription.
  • Maximum Length: 255
    Pattern: ^[^ ]*$
    The unique name of the event subscription.
  • Maximum Length: 349525
    The shape of the template object used to send the notification.
  • namedIDs-eventSubscriptions-objectVersion
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • namedIDs-eventSubscriptions-status
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • The date and time when the event subscription was last updated. This attribute is read-only.
Nested Schema : namedIDs-eventSubscriptions-eventType
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-integrationUser
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-objectVersion
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-status
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Back to Top

Response

Default Response

Body ()
Root Schema : eventSubscriptions
Type: object
The event-based subscription management object that allows external applications to discover objects that can be subscribed.
Show Source
  • Maximum Length: 256
    Pattern: ^(Contact|Organization|Incident)$
    The string which represents the type of object in the ObjectShapeXML.
  • The date and time when the event subscription was created. This attribute is read-only.
  • Maximum Length: 1333
    The URL to post the notification event. Note: If an endpoint is registered as a callback, it should contain the fully qualified domain name. For example: "endpoint" : "https://mydomain-name.com:[port-number]/myEventReceiverService"
  • namedIDs-eventSubscriptions-eventType
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • Minimum Value: 1
    Maximum Value: 9223372036854776000
    The unique identifier of the event subscription.
  • namedIDs-eventSubscriptions-integrationUser
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • Maximum Length: 255
    The name used to look up the event subscription.
  • Maximum Length: 255
    Pattern: ^[^ ]*$
    The unique name of the event subscription.
  • Maximum Length: 349525
    The shape of the template object used to send the notification.
  • namedIDs-eventSubscriptions-objectVersion
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • namedIDs-eventSubscriptions-status
    An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
  • The date and time when the event subscription was last updated. This attribute is read-only.
Nested Schema : namedIDs-eventSubscriptions-eventType
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-integrationUser
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-objectVersion
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Nested Schema : namedIDs-eventSubscriptions-status
Type: object
An ID which has an associated name string. These IDs can be set by either value or name. If the name cannot uniquely determine the value, an error is generated.
Show Source
Back to Top

Examples

Use POST with the following syntax to create a new event subscription object:

https://your_site_interface/services/rest/connect/version/eventSubscriptions

Request URI example

https://mysite.example.com/services/rest/connect/v1.4/eventSubscriptions

Request body example

{
"name": "MyContactCreateSubscription",
"class": "Contact",
"endPoint": "https://myEventReceiverService",
"eventType": {
    "id": 1},
"integrationUser": {
    "id": 1},
"objectVersion": {
    "id": 100300},
"objectShapeXml": "<n0:TriggeringObject xmlns:n0=\"urn:messages.ws.rightnow.com/v1_4\"
 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"n1:Contact\"
 xmlns:n1=\"urn:objects.ws.rightnow.com/v1_4\"><n1:Notes></n1:Notes></n0:TriggeringObject>"
}

Note:

  • All of the fields in the example request body are required for event subscriptions.
  • The endpoint URL must point to a SOAP service that implements or conforms to the event WSDL. The event WSDL can be found at:
    http://your_site_interface/cgi-bin/your_interface.cfg/services/soap?wsdl=event
  • Quotation marks inside the objectShapeXml field value must be escaped (replaced with &quot; or \") to avoid JSON syntax errors. You must also preserve spaces between XML namespace attributes.

Response body example

{
  "id": 10004,
  "lookupName": "MyContactCreateSubscription",
  "createdTime": "2016-03-22T13:44:30.000Z",
  "updatedTime": "2016-03-22T13:44:30.000Z",
  "class": "Contact",
  "endPoint": "https://myEventReceiverService",
  "eventType": {
    "id": 1,
    "lookupName": "Create"
  },
  "integrationUser": {
    "id": 1,
    "lookupName": "ICS Integration"
  },
  "name": "MyContactCreateSubscription",
  "objectShapeXml": "<n0:TriggeringObject xmlns:n0="urn:messages.ws.rightnow.com/v1_4"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="n1:Contact"
    xmlns:n1="urn:objects.ws.rightnow.com/v1_4"><n1:Notes></n1:Notes></n0:TriggeringObject>",
  "objectVersion": {
    "id": 100300,
    "lookupName": "v1.4"
  },
  "status": {
    "id": 1,
    "lookupName": "Active"
  },
  "links": [
    {
      "rel": "self",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/eventSubscriptions/10004"
    },
    {
      "rel": "canonical",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/eventSubscriptions/10004"
    },
    {
      "rel": "describedby",
      "href": "https://mysite.example.com/services/rest/connect/v1.4/metadata-catalog/
       eventSubscriptions",
      "mediaType": "application/schema+json"
    }
  ]
}
Back to Top