Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

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

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

/api/solutions/programregistration/campaign

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

Header

Key

Value

Content-Type

application/json

Authorization

Bearer {{token}}

Request Body

raw > JSON

Without email Template name

{
    "projectId": "61012d9521be05006dce38cb",
    "channel": "email",
    "event": "sent",
    "action" : "link",
    "attributes" : {
        "camp" : "10001",
        "endpoints": ["example1@example.com", "example2@example.com"]
    }
}

With email Template name

{
    "projectId": "61012d9521be05006dce38cb",
    "channel": "email",
    "event": "sent",
    "action" : "link",
    "emailTemplateName": "sampleemailtemplate"
    "attributes" : {
        "camp" : "10001",
        "endpoints": ["testuser@example.com", "testusertwo@example.com"]
    }
}

Without email Template name: You have to configure the email subject, body, and so on in the configure settings.https://orbita.atlassian.net/wiki/spaces/OCS/pages/1820950585/Program+Registration+Solution#Configure-Settings

With email Template name: You have to configure the email subject, body, and so on in the Email template.
https://orbita.atlassian.net/wiki/spaces/OCS/pages/1820950585/Program+Registration+Solution#How-to-update-the-email-template-sent-to-the-User-with-my-customer-brand%3F

Response Body

200 OK

{
    "message": "Campaign is processed sucessfully."
}

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

  • No labels