Document Subscriber

Create subscriber

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

POST https://app-a.nipamail.com/api/v1/subscribers
Parameter Type Description Required
session_key string The session_key from Authentication API. Yes
list_id string The ID of the list you want to create subscribers. Yes
emails string Email you want add to list. Yes
Example Request
POST /api/v1/subscribers HTTP/1.1 
session_key: ffa67286202c04c8af6aeb512579ead5d5896054aabb071
Host: app-a.nipamail.com

list_id=ALT8762129678
emails=example@mail.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",
  "code": 200,
  "data": {
    "subscriber_id": "AST2375629660"
  }
}

Show all subscribers

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

GET https://app-a.nipamail.com/api/v1/subscribers
Parameter Type Description Required
session_key string The session_key from Authentication API. Yes
page integer set limit of result page.
Defaults to 1 of limit 25 item
Example Request
GET /api/v1/subscribers HTTP/1.1 
session_key: ffa67286202c04c8af6aeb512579ead5d5896054aabb071
Host: app-a.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",
  "code": 200,
  "data": {
    "subscribers_count": 1,
    "subscribers_result": [
      {
        "subscriber_id": "AST2375629660",
        "columns": {
          "email": "thaksinai@ispio.com"
        },
        "create": "2017-04-29 17:46:22"
      }
    ]
  }
}

View subscribers

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

GET https://app-a.nipamail.com/api/v1/subscribers/{$id}
Parameter Type Description Required
session_key string The session_key from Authentication API. Yes
Example Request
GET /api/v1/subscribers/AST2375629660 HTTP/1.1 
session_key: ffa67286202c04c8af6aeb512579ead5d5896054aabb071
Host: app-a.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",
  "code": 200,
  "data": {
    "subscribers_count": 1,
    "subscribers_result": [
      {
        "subscriber_id": "AST2375629660",
        "columns": {
          "email": "thaksinai@ispio.com"
        },
        "status": "subscriber",
        "create": "2017-04-29 17:46:22"
      }
    ]
  }
}

Update subscribers

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

POST https://app-a.nipamail.com/api/v1/subscribers/{$id}/update
Parameter Type Description Required
session_key string The session_key from Authentication API. Yes
email string The email of the list you want to update.
other string The data of the columns. You can check for View list subscriber.
Example Request
POST /api/v1/subscribers/AST2375629660/update HTTP/1.1 
session_key: ffa67286202c04c8af6aeb512579ead5d5896054aabb071
Host: app-a.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",
  "code": 200,
  "data": {
    "result": "Update list /ALT8762129678/ successfully."
  }
}

Delete subscribers

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

POST https://app-a.nipamail.com/api/v1/subscribers/{$id}/delete
Parameter Type Description Required
session_key string The session_key from Authentication API. Yes
Example Request
POST /api/v1/subscribers/AST2375629660/delete HTTP/1.1 
session_key: ffa67286202c04c8af6aeb512579ead5d5896054aabb071
Host: app-a.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",
  "code": 200,
  "data": {
    "result": "Delete subscriberssuccessfully."
  }
}

Response Code
Code Result Description
200 success Response to a successful request.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized or the session_id was expired.
404 error The list not found.