Mapp Connect API · mapp-digital/php-client Wiki · GitHub
Skip to content

Mapp Connect API

Mapp Connect edited this page Sep 13, 2021 · 1 revision

Authentication

API Keys Each integration will have a unique ID, this ID and random secret (if enabled) can be used to sign REST requests using HMAC Authentication. (https://en.wikipedia.org/wiki/Message_authentication_code)

Services

EU L3 cluster: https://jamie.g.shortest-route.com/charon/api/v1/

US L3 cluster: https://jamie.a.shortest-route.com/charon/api/v1/

EMC cluster: https://jamie.h.shortest-route.com/charon/api/v1/

EMC-US cluster: https://jamie.c.shortest-route.com/charon/api/v1/

Mapp Connect Endpoints

  • PING
  • CONNECT
  • EVENT

Examples

PING

GET//ping For testing connectivity and authentication

Example response:

{ "ping": true, "integrationId": "47291122-e5bb-4865-a107-a68ec9957325", "timestamp": 1555054882877 }

CONNECT

POST//connect For setting config params and changing status to 'Connected'

Example request:

{ "params":{ "magentourl":"www.supermagento.pl", "someconfigparam":"42" } }

Response: HTTP status code

EVENT

POST /integration//event{?subtype=} Request body can contain any JSON object. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"xx", }

Response: HTTP status code

Event types:

  • user - add/updates contact data in Mapp Engage
  • email - sends single or group email - requires prepared message-id
  • sms- sends SMS to contact (either a phone number or to contact email if this contact has a phone number) - requires prepared SMS message-id
  • push - sends push message (prepared message) to contact - requires to push message Id also App ID
  • transaction - stores order data in Transactional RD and if prepared message-id is included send the order email using a predefined structure
  • automation - sends 3rd party event to Engage and if there is automation (Whiteboard) set for this event name its triggered

Examples

* Adding a user and subscribing to the group *

POST /integration//event?subtype=user Request body can contain any JSON object. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"user", "email":"user@mapp.com", "group":"2324333335", }

Response: HTTP status code


* Removing a user

POST /integration//event?subtype=user FLAG: 'delete'

Request body can contain any JSON object. Example event that is sent to Kafka:

` { "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"user", "email":"user@mapp.com", "group":"2324333335", "delete":"true"

} `

Response: HTTP status code

Unsubscribing to the group 

POST /integration//event?subtype=user FLAG: 'unsubscribe'

Request body can contain any JSON object. Example event that is sent to Kafka:

{     "id":"6d329d9b-201a-4188-a429-7e45d9a674a8",    "timestamp":1555401662153,    "integrationId":"47291122-e5bb-4865-a107-a68ec9957325",    "type":"Import",    "subtype":"user",    "email":"user@mapp.com",     "group":"2324333335",    "unsubscribe":"true" }

Response: HTTP status code


Send prepared SMS message to a user with parameters

POST /integration//event?subtype=sms Request body can contain any JSON object. MessageId it's an ID of the prepared message. Either 'email', 'recipientMobileNumber' or 'recipientId' can be used as an identifier. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"sms", "recipientMobileNumber":"+48666777888", "messageId":"2324333335", "param1":"param 1 value" }

Response: HTTP status code

Example payload that the API can accept:

{"recipientMobileNumber":"+48666777888","messageId":"2324333335","param1":"param 1 value"}


Send prepared Push message to a user with parameters

POST /integration//event?subtype=push Request body can contain any JSON object, 'pushMessageId' is an ID of push message template (not the campaign), 'mobileAppId' refers to the app that should be used, 'email' is used as user identifier. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"push", "email":"andrzej.wuda@xx.xx", "pushMessageId":"1234", "mobileAppId":"5678", "param1":"param 1 value" }

Response: HTTP status code

Example payload that the API can accept:

{"email":"test@test.xx","pushMessageId":"1234","mobileAppId":"5678","param1":"param 1 value"}


Send a single message to a user with parameters

POST /integration//event?subtype=email Request body can contain any JSON object. MessageId it's an ID of the prepared message. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"email", "email":"user@mapp.com", "messageId":"2324333335", }

Response: HTTP status code


Send a group message with parameters

POST /integration//event?subtype=email Request body can contain any JSON object. MessageId it's an ID of the prepared message. Example event that is sent to Kafka:

`{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"email", "group":"12", "messageId":"2324333335", "params":"valsue1"

} `


Send a transactional email and store transaction (order) details in Transactional RD

POST /integration//event?subtype=transaction Request body can contain any JSON object. MessageId it's an ID of the prepared message. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"transaction", "email":"user@mapp.com", "messageId":"2324333335", "items":[{"sku":"JB-129","name":"Dungen-H","price":"15","qty_ordered":"1"}], "group":"1200073880", "orderId":"1012", "timestamp": "2020-04-28T12:30:08.537Z", "currency":"GBP" }


Save transaction (order) details in Transactional RD without sending transactional email

POST /integration//event?subtype=transaction Request body can contain any JSON object. MessageId it's an ID of the prepared message. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"transaction", "email":"user@mapp.com", "items":[{"sku":"JB-129","name":"Dungen-H","price":"15","qty_ordered":"1"}], "group":"1200073880", "orderId":"1012", "timestamp": "2020-04-28T12:30:08.537Z", "currency":"GBP" }


Trigger automation (Whiteboard plan)

POST /integration//event?subtype=automation Request body can contain any JSON object. MessageId it's an ID of the prepared message. Example event that is sent to Kafka:

{ "id":"6d329d9b-201a-4188-a429-7e45d9a674a8", "timestamp":1555401662153, "integrationId":"47291122-e5bb-4865-a107-a68ec9957325", "type":"Import", "subtype":"automation", "email":"user@mapp.com", "external_event":"new_account", "value1":"account_URL" }