POST rule engine/triggers

(Difference between revisions)
Jump to: navigation, search
(JSON Parameters)
Line 12: Line 12:
  
 
{|
 
{|
! align="left" width="200px" | appliance_id
+
! align="left" width="200px" | trigger
| width="200px" | optional
+
| width="200px" | required
| Motorola ADSP identifier.
+
| A hash in the format field:value, with the necessary fields for the trigger:
 
|-
 
|-
! align="left" width="200px" | mac_address
+
! align="left" width="200px" style="padding-left: 20px" | account_source
| width="200px" | required <sup>1</sup>
+
| width="200px" | required
| user MAC Address.
+
| Type of account source. Allowed values: ''account'', ''adsp''.
 
|-
 
|-
! align="left" width="200px" | mpact_client_id
+
! align="left" width="200px" style="padding-left: 20px" | account_identifier
 
| width="200px" | required <sup>1</sup>
 
| width="200px" | required <sup>1</sup>
| user Motorola MPact Client ID.
+
| Value of account source.
 
|-
 
|-
! align="left" width="200px" | login_user_id
+
! align="left" width="200px" style="padding-left: 20px" | login_user_source
| width="200px" | required <sup>1</sup>
+
| width="200px" | required
| user identifier.
+
| Type of login user source. Allowed values: ''login_user'', ''mac_address'', ''mpact_client_id''.
 
|-
 
|-
! align="left" width="200px" | event_type
+
! align="left" width="200px" style="padding-left: 20px" | login_user_identifier
 
| width="200px" | required
 
| width="200px" | required
| type of the event to be triggered.
+
| Value of login user source.
 
|-
 
|-
! align="left" width="200px" | event_attrs
+
! align="left" width="200px" style="padding-left: 20px" | event_type
 
| width="200px" | optional
 
| width="200px" | optional
| a hash in the format field:value, with specific parameters for the triggered event.
+
| Type of the event to be triggered.
 +
|-
 +
! align="left" width="200px" style="padding-left: 20px" | event_attrs
 +
| width="200px" | optional
 +
| A hash in the format field:value, with specific parameters for the triggered event.
 
|}
 
|}
  
<sup>1</sup> User identifier: the user for whom the event will be triggered must be informed by the fields "mac_address", "mpact_client_id" or "login_user_id". Therefore, one of these fields must be given.
+
<sup>1</sup> Must not be informed if ''account_source'' is set to ''account'', as the value is inferred from the authentication.
  
 
== Authentication ==
 
== Authentication ==
Line 62: Line 66:
  
 
== Examples ==
 
== 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 ====
 
==== Request ====
  
curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
+
  curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
   -d '{"appliance_id": "24E3S8Z7S6CYI91IOOFN",
+
   -d '{
      "login_user_id": "873",
+
        "account_source": "adsp",
      "event_type": "region_exit",
+
        "account_identifier": "24E3S8Z7S6CYI91IOOFN",
      "event_attrs": { "region_name": "region A" } }' \
+
        "login_user_source": "mac_address",
 +
        "login_user_identifier": "0a:1b:2c:3d:4e:5f",
 +
        "event_type": "region_entered",
 +
        "event_attrs": {
 +
          "region_name": "region A"
 +
        }
 +
      }' \
 
   -H 'Content-type: application/json' \
 
   -H 'Content-type: application/json' \
 
   --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf
 
   --user 138:e8b9ca24f1b590af67e6271297d6e1f7226625d61c5b5daa1b2f215464e292cf

Revision as of 18:14, 10 May 2017

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

trigger required A hash in the format field:value, with the necessary fields for the trigger:
account_source required Type of account source. Allowed values: account, adsp.
account_identifier required 1 Value of account source.
login_user_source required Type of login user source. Allowed values: login_user, mac_address, mpact_client_id.
login_user_identifier required Value of login user source.
event_type optional 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 Must not be informed if account_source is set to account, as the value is inferred from the authentication.

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

Request

 curl -iX POST 'https://api.socialidnow.com/v1/marketing/rule_engine/triggers' \
 -d '{
       "account_source": "adsp",
       "account_identifier": "24E3S8Z7S6CYI91IOOFN",
       "login_user_source": "mac_address",
       "login_user_identifier": "0a:1b:2c:3d:4e:5f",
       "event_type": "region_entered",
       "event_attrs": {
         "region_name": "region A"
       }
     }' \
 -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