Skip to main content

Uniphore Customer Portal

Email API

Email API
Endpoint

Method: POST

URL: https://<host>/contacts/email

Mandatory Attributes

Name

Description

Data Type

Length

Comments

data.agentEmailId

Agent Email Address

String

256

This is required to determine agent vs participant for Incoming and Outgoing messages.

data.agentId

Agent Identifier

String

50

data.body

Email Body

String

1 MB

data.convId

Conversation Identifier

String

256

UUID, Email Conversation Identifier

data.from

From Address

String

256

data.lang

Language Code

String

5

us-en, au-en, gb-en

data.msgId

Messages Identifier

String

36

UUID, Email Thread Identifier

data.psEmailId

Participant Email Address

String

256

Would require to determine the addressed participant.

data.psId

Participant Identifier

String

50

data.sub

Email Subject

String

78

RFC-5322

data.to

To Address

String Array

data.ts

Sent/Received Timestamp

Long

metadata.catName

Name of Category Name

String

128

metadata.orgName

Name of the Organization

String

128

metadata.tenantName

Name of the Client

String

128

Optional Attributes

Name

Description

Data Type

Length

Comments

data.cc/bcc

CC or BCC

String Array

data.journeyId

Journey Identifier

String

256

UUID, Journey Identifier

metadata.metadataMap

Name of Metadata Map Parameter

String

A maximum of 50 non-Speech metadata keys per category. Refer Restricted Metadata Field List.

Request
curl --location --request POST 'https://host/contacts/email' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 1234567890' \
--data-raw '{
  "metadata": {
    "tenantName": "Acme Corp",
    "orgName": "Sales",
    "catName": "Leads"
  },
  "data": {
    "convId": "0238ef3c-4252-11ea-b77f-2e728ce88125",
    "msgId": "0238f22a-4252-11ea-b77f-2e728ce88125",
    "lang": "us-en",
    "sub": "Goods Delivary Status",
    "ts": 1577836800000,
    "body": "Hi John, I'm writing this email to enquire about the my delivery status",
    "agentId": "Agent1",
    "psId": "Participant1",
    "agentEmailId": "agent1@xyz.com",
    "psEmailId": "ps1@acmecorp.com",
    "from": "agent1@xyz.com",
    "to": [
      "ps1@acmecorp.com",
      "ps2@acmecorp.com"
    ],
    "journeyId": "02d8f01e-42b0-11ea-b77f-2e728ce88125"
  }
}'
Request with Additional Metadata
curl --location --request POST 'https://host/contacts/email' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 1234567890' \
--data-raw '{
  "metadata": {
    "tenantName": "Acme Corp",
    "orgName": "Sales",
    "catName": "Leads",
    "metadataMap": {"custom-test-key-3":"custom-test-value-3",
                    "custom-test-key-4":"custom-test-value-4"}
  },
  "data": {
    "convId": "0238ef3c-4252-11ea-b77f-2e728ce88125",
    "msgId": "0238f22a-4252-11ea-b77f-2e728ce88125",
    "lang": "us-en",
    "sub": "Goods Delivary Status",
    "ts": 1577836800000,
    "body": "Hi John, I'm writing this email to enquire about the my delivary status",
    "agentId": "Agent1",
    "psId": "Participant1",
    "agentEmailId": "agent1@xyz.com",
    "psEmailId": "ps1@acmecorp.com",
    "from": "agent1@xyz.com",
    "to": [
      "ps1@acmecorp.com",
      "ps2@acmecorp.com"
    ],
    "journeyId": "02d8f01e-42b0-11ea-b77f-2e728ce88125"
  }
}'
Success response
{
  "status": 202
  "message": "accepted"
}
Error response
Http Status : can be one of 400, 401, 403, 404, 500, 503

{
  "status": 400,
  "errors": [
    {
      "type": "/errors/contact-payload",
      "title": "entity-identifier",
      "detail": "tenant/org/cat not found!"
    }
  ]
}