Table of Contents |
---|
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.
Status | ||||
---|---|---|---|---|
|
Code Block |
---|
/api/login |
Example usage: https://sandbox5.orbita.cloud:8443/api/login
Header
Key | Value |
---|---|
Content-Type | application/json |
Request Body
raw > JSON
Code Block |
---|
{
"username":"example@orbita.com",
"password":"Password@123"
} |
Response Body
200 OK
Code Block |
---|
{
"success": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
} |
Steps to follow
Log in to the environment using Login API
{{url}}/api/login
withMethod: POST
.Select body > raw > JSON and use the admin’s username and password in the request body.
Under the header tab, use the Key-Value pair
Content-Type: applicaton/json
and click “Send”You will receive a
token
in the response body.Copy the token for later use. We recommend using the environment variables to store frequently used data.
Campaign API
Status | ||||
---|---|---|---|---|
|
Code Block |
---|
/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
Code Block |
---|
{
"projectId": "61012d9521be05006dce38cb",
"channel": "email",
"event": "sent",
"action" : "link",
"attributes" : {
"camp" : "10001",
"endpoints": ["example1@example.com", "example2@example.com"]
}
}
|
With email template name
Code Block |
---|
{
"projectId": "61012d9521be05006dce38cb",
"channel": "email",
"event": "sent",
"action" : "link",
"emailTemplateName": "sampleemailtemplate"
"attributes" : {
"camp" : "10001",
"endpoints": ["testuser@example.com", "testusertwo@example.com"]
}
} |
Response Body
200 OK
Code Block |
---|
{
"message": "Campaign is processed sucessfully."
} |
Steps to follow
Use the Campaign API
{{url}}/api/solutions/programregistration/campaign
withMethod: POST
In the Header tab, use the following the Key-Value pairs
Content-Type: applicaton/json
Authorization: Bearer {{token}}
- The token you copied from the response body of the Login API goes here.
Set the request Body to > raw > JSON
Add the request body With/Without email Template name as shown in the below screenshot and click the “Send” button.
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
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
|
...
|