POST rule engine/triggers

(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
#REDIRECT [[POST rule engine/triggers PT-BR]]
+
== Description ==
 +
 
 +
Trigger an event for a Social Login user.
 +
 
 +
== Resource URL ==
 +
 
 +
  POST https://api.socialidnow.com/v1/marketing/rule_engine/triggers
 +
 
 +
== Parameters ==
 +
 
 +
=== JSON Parameters ===
 +
 
 +
{|
 +
! align="left" width="200px" | appliance_id
 +
| width="200px" | required <sup>1</sup>
 +
| Motorola ADSP identifier.
 +
|-
 +
! align="left" width="200px" | account_id
 +
| width="200px" | required <sup>1</sup>
 +
| Marketing Account identifier.
 +
|-
 +
! align="left" width="200px" | mac_address
 +
| width="200px" | required <sup>2</sup>
 +
| user mac address.
 +
|-
 +
! align="left" width="200px" | login_user_id
 +
| width="200px" | required <sup>2</sup>
 +
| user identifier.
 +
|-
 +
! align="left" width="200px" | event_type
 +
| width="200px" | required
 +
| type of the event to be triggered.
 +
|-
 +
! align="left" width="200px" | event_attrs
 +
| width="200px" | optional
 +
| a hash in the format field:value, with specific parameters for the triggered event.
 +
|}
 +
 
 +
<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>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 ==
 +
 
 +
This API requires Marketing Account authentication. See [[Authentication]].
 +
 
 +
== Response ==
 +
 
 +
=== Response Status ===
 +
 
 +
{|
 +
! align="left" width="200px" | accepted (202)
 +
| The event was accepted and will be processed.
 +
|-
 +
! align="left" width="200px" | bad_request (400)
 +
| Some required parameter was not informed.
 +
|-
 +
! align="left" width="200px" | unauthorized (401)
 +
| The authentication is wrong. See [[Authentication]].
 +
|-
 +
! align="left" width="200px" | 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

Revision as of 18:54, 3 November 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 1 Motorola ADSP identifier.
account_id required 1 Marketing Account identifier.
mac_address required 2 user mac address.
login_user_id required 2 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 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.

2 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