POST rule engine/triggers

(Difference between revisions)
Jump to: navigation, search
(JSON Parameters)
Line 13: Line 13:
 
{|
 
{|
 
! align="left" width="200px" | appliance_id
 
! align="left" width="200px" | appliance_id
| width="200px" | required <sup>1</sup>
+
| width="200px" | required
 
| Motorola ADSP identifier.
 
| Motorola ADSP identifier.
 
|-
 
|-
! align="left" width="200px" | account_id
+
! align="left" width="200px" | mac_address
 
| width="200px" | required <sup>1</sup>
 
| width="200px" | required <sup>1</sup>
| Marketing Account identifier.
 
|-
 
! align="left" width="200px" | mac_address
 
| width="200px" | required <sup>2</sup>
 
 
| user mac address.
 
| user mac address.
 
|-
 
|-
 
! align="left" width="200px" | login_user_id
 
! align="left" width="200px" | login_user_id
| width="200px" | required <sup>2</sup>
+
| width="200px" | required <sup>1</sup>
 
| user identifier.
 
| user identifier.
 
|-
 
|-
Line 37: Line 33:
 
|}
 
|}
  
<sup>1</sup> The Marketing Account in which the event will be triggered must be informed by the fields "appliance_id" or "account_id". Therefore, one of these fields must be given.
+
<sup>1</sup> The user for whom the event will be triggered must be informed by the fields "mac_address" or "login_user_id". Again, one of these fields must be given.
 
+
<sup>2</sup> The user for whom the event will be triggered must be informed by the fields "mac_address" or "login_user_id". Again, one of these fields must be given.
+
  
 
== Authentication ==
 
== Authentication ==

Revision as of 13:23, 26 December 2014

Contents

Description

Trigger an event for a Social Login user.

Resource URL

  POST https://api.socialidnow.com/v1/marketing/rule_engine/triggers

Parameters

JSON Parameters

appliance_id required Motorola ADSP identifier.
mac_address required 1 user mac address.
login_user_id required 1 user identifier.
event_type required type of the event to be triggered.
event_attrs optional a hash in the format field:value, with specific parameters for the triggered event.

1 The user for whom the event will be triggered must be informed by the fields "mac_address" or "login_user_id". Again, one of these fields must be given.

Authentication

This API requires Marketing Account authentication. See Authentication.

Response

Response Status

accepted (202) The event was accepted and will be processed.
bad_request (400) Some required parameter was not informed.
unauthorized (401) The authentication is wrong. See Authentication.
internal_server_error (500) An unknown error happened.

Examples

Using appliance_id and mac_address

Request

curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
 -d '{"appliance_id": "24E3S8Z7S6CYI91IOOFN",
      "mac_address": "0a:1b:2c:3d:4e:5f",
      "event_type": "presence_entered"} }' \
 -H 'Content-type: application/json' \
 --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 202 Accepted
Status: 202

Using appliance_id and login_user_id

Request

curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
 -d '{"appliance_id": "24E3S8Z7S6CYI91IOOFN",
      "login_user_id": "873",
      "event_type": "region_exit",
      "event_attrs": { "region_name": "region A" } }' \
 -H 'Content-type: application/json' \
 --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 202 Accepted
Status: 202

Using account_id and mac_address

Request

curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
 -d '{"account_id": "921",
      "mac_address": "0a:1b:2c:3d:4e:5f",
      "event_type": "region_near",
      "event_attrs": { "region_name": "external area" } }' \
 -H 'Content-type: application/json' \
 --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 202 Accepted
Status: 202

Using account_id and login_user_id

Request

curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
 -d '{"account_id": "921",
      "login_user_id": "873",
      "event_type": "presence_exit"} }' \
 -H 'Content-type: application/json' \
 --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Response

Response Headers
HTTP/1.1 202 Accepted
Status: 202
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox