Campaign API

 

As an admin user, you can use the Campaign API to send campaign emails to the users' email addresses.

Login API

You should log in as an admin user to use the Campaign API.

POST

/api/login

Example usage: https://sandbox5.orbita.cloud:8443/api/login

Header

Key

Value

Key

Value

Content-Type

application/json

Request Body

raw > JSON

{             "username":"example@orbita.com",             "password":"Password@123" }

Response Body

200 OK

{ "success": true, "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9" }

Steps to follow

  1. Log in to the environment using Login API {{url}}/api/login with Method: POST.

  2. Select body > raw > JSON and use the admin’s username and password in the request body.

     

  3. Under the header tab, use the Key-Value pair Content-Type: applicaton/json and click “Send

     

  4. You will receive a token in the response body.

     

  5. Copy the token for later use. We recommend using the environment variables to store frequently used data.

Campaign API

POST

Example usage: https://sandbox5.orbita.cloud:8443/api/solutions/programregistration/campaign

Header

Key

Value

Key

Value

Content-Type

application/json

Authorization

Bearer {{token}}

Request Body

raw > JSON

Without email Template name

With email Template name

Without email Template name: You have to configure the email subject, body, and so on in the configure settings.Program Registration Solution Component | Configure Settings

With email Template name: You have to configure the email subject, body, and so on in the Email template. How do I customize an email template?

Response Body

200 OK

Steps to follow

  1. Use the Campaign API {{url}}/api/solutions/programregistration/campaign with Method: POST

  2. In the Header tab, use the following the Key-Value pairs

    1. Content-Type: applicaton/json

    2. Authorization: Bearer {{token}} - The token you copied from the response body of the Login API goes here.

  3. Set the request Body to > raw > JSON

  4. Add the request body With/Without email Template name as shown in the below screenshot and click the “Send” button.

     

  5. You will receive a response with status code 200.

The emails will be sent to all the email addresses in the endpoints array of the request body "endpoints":[]

Related Articles