POST rule engine/triggers
From Social ID Developers
Revision as of 20:53, 3 November 2014 by Gabriel.prado (Talk | contribs)
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