Document Transactional

Send transaction to other email

Below, we listed the request parameters that required on /transactional API and resource url.

POST https://app-{{ domain_app }}.nipamail.com/v1.0/transactional/post

* domain_app : a, b and x

Parameter Type Description Required
accept_token string The accept_token from Authentication API. Yes
from_email string The sender's email address. Yes
from_name string The sender's name. Yes
to string The recipient's email address. Yes
reply_email string The reply-email.
reply_name string The reply-name.
cc string The cc specified with email separate by comma.
bcc string The BCC of email separate by comma.
subject string The email's subject. Yes
message string The content email in html form, in case use template key put custom field in json format here. Yes
package_key string If you have more than one package, you can choose which package to send. If package_key is not sent, we will use the default package to send.
attachment file The json string of attachments specified with file name and file path.
max size 500Kb. [ gif | jpg | png | pdf | xlsx | csv | xls | zip | rar ]
template_id string The template key need to use html content.
parameters array The variable that will be used to change the value in the template.
disable_unsubscribe string Disable unsubscribe menu tab.
Example Request
POST /v1.0/transactional/post/json?accept_token=ffa67286202c04c8af6aeb512579ead5d5896054aabb071 
Host: app-{{ domain_app }}.nipamail.com

from_name=userSupport&from_email=example@mail.com&to=mailto@mail.com&subject=Welcome+to+transactional+system&message=content+html
Example Result Success
Once you execute the above API call, you will receive either a success data or error data in JSON format

{
  "id": "d2c20f0fbacea693890e7af5be4e5233",
  "status": "success",
  "message": "The email was delivered",
  "credits": 4489,
  "date": "2019-04-05 10:51:39",
  "status_code": 200
}

Example Result Fail
Once you execute the above API call, you will receive either a success data or error data in JSON format

{
  "id": "94238ac7866eedd28e8264bed97b3d33",
  "status": "error",
  "message": "The format of the email is invalid.",
  "credits": 4489,
  "date": "2019-04-05 11:09:00",
  "status_code": 400
}

Response Code

Status_code Result Description
200 success Response to a successful request.
201 Fail The request is malformed or missing some required parameters.
  • Package not found.
  • This request used credit over remaining credit.
  • Syntax email error.
  • This email has been unsubscribed.
  • Emails is bounce domain,domain does not exist.
  • This email has declined your email due to a spam complaint.
  • Email delivery failed.
  • The file you are attempting to upload is larger than the permitted size.
  • Error attachment upload.
204 Fail The request is malformed template.
  • Can't find content or template ID.
  • Content was not found in your template.
302 error Invalid redirect URL.
400 error The request is malformed or missing some required parameters.
  • The format of the email is invalid.
  • This email has been unsubscribed from you.
  • File name in attachment not found.
  • Required field must not be blank
401 error Unauthorized or the token was expired.
405 error The request method is not supported for the requested resource.
412 error Empty data.
500 error Server problem.
503 error Not enough credit to send this campaign or email.
Connection error, please try again later.

Send transaction by submit form

Below, we listed the request parameters that required on /transactional/post/form API and resource url.

POST https://app-{{ domain_app }}.nipamail.com/v1.0/transactional/post/form

* domain_app : a, b and x

Parameter Type Description Required
accept_token string The accept_token from Authentication API. Yes
redirect_uri string Callback URL is the name of your future callback. Yes
from_email string The sender's email address. Yes
from_name string The sender's name. Yes
to string The recipient's email address. Yes
reply_email string The reply-email.
reply_name string The reply-name.
cc string The cc specified with email separate by comma.
bcc string The BCC of email separate by comma.
subject string The email's subject. Yes
message string The content email in html form, in case use template key put custom field in json format here. Yes
package_key string If you have more than one package, you can choose which package to send. If package_key is not sent, we will use the default package to send.
attachment file The json string of attachments specified with file name and file path.
max size 500Kb. [ gif | jpg | png | pdf | xlsx | csv | xls | zip | rar ]
template_id string The template key need to use html content.
parameters array The variable that will be used to change the value in the template.
disable_unsubscribe string Disable unsubscribe menu tab.
Example Request
POST /v1.0/transactional/post/form?accept_token=ffa67286202c04c8af6aeb512579ead5d5896054aabb071 
Host: app-{{ domain_app }}.nipamail.com

redirect_uri=https://your_website/your_webpage/_callback.php&from_name=userSupport&from_email=example@mail.com&to=mailto@mail.com&subject=Welcome+to+transactional+system&message=content+html

View transactional

Below, we listed the request parameters that required on /transactional API and resource url.

GET https://app-{{ domain_app }}.nipamail.com/v1.0/transactional/{$id}
Parameter Type Description Required
accept_token string The accept_token from Authentication API. Yes
tran_id string The tran_id use for tracking statistic. Yes
page integer set limit of result page.
Defaults to 1 of limit 25 item
fields enum {open, click} Option to Read related information campaign.

If you want to report a relevant section. Can be browsed with
(e.g. https://app-{{ domain_app }}.nipamail.com/v1.0/transactional?fields=open&accept_token=ffa6728620... OR https://app-{{ domain_app }}.nipamail.com/v1.0/transactional?fields=open,click&accept_token=ffa6728...)
Example Request
GET /v1.0/transactional/d06b445906662f37314e79d48f62cf9c?accept_token=ffa67286202c04c8af6aeb512579ead5d5896054aabb071 
Host: app-{{ domain_app }}.nipamail.com
Example Result
Once you execute the above API call, you will receive either a success data or error data in JSON format

{
  "status":"success",
  "data":{
    "tran_id":"d06b445906662f37314e79d48f62cf9c",
    "app_id":"XA4218308219",
    "from":"zamnomo@hotmail.com",
    "to":"thaksinai@ispio.com",
    "open":0,
    "click":0,
    "unsubscriber":0,
    "create_day":"2018-02-12",
    "create_date":"2018-02-12 13:59:00",
    "status":"wait"
  },
  "date":"2018-02-12 13:59:27"
}