These walkthroughs show you how to authenticate with the Salesmsg Public API and try basic operations: one uses a Personal Access Token in Swagger, the other an OAuth2 token in Postman.
Salesmsg Public API Usage with PAT and Swagger
This is step-by-step walkthrough of how to use the Salesmsg Public API with a personal access token and Swagger. Follow these instructions to authenticate and perform basic API operations such as retrieving conversations, messages, and sending replies.
1. Generate a Personal Access Token
Login to Salesmsg:
Access your Salesmsg account.
Navigate to Token Settings:
Go to Settings > Personal Access Token.
Create a Token:
Click on Create Token.
Provide a name for the token (e.g., API Access Token).
NEW! Select desired scopes
Click Create.
Copy the Token:
Once the token is generated, copy it for later use.
2. Access Swagger and Authorize
Open Swagger:
Navigate to the Swagger UI page (ensure you're using version 2.3).
Authorize with Token:
Scroll down to the Authorize button at the top of the page.
Paste your personal access token into the provided field.
Click Authorize to complete authentication.
3. Perform API Operations
a. Retrieve Conversations
Find the Endpoint:
Locate the
GET /conversationsendpoint in Swagger.
Test the Request:
Click Try it out.
Specify any filters (e.g., date range for messages sent/received).
Click Execute.
View Results:
Review the returned data, which includes a list of conversations and their details.
b. Retrieve Messages in a Conversation
Get a Conversation ID:
From the retrieved conversations, copy the Conversation ID.
Find the Endpoint:
Locate the
GET /conversations/{id}/messagesendpoint in Swagger.
Test the Request:
Click Try it out.
Paste the Conversation ID and specify parameters (e.g., the number of messages to retrieve).
Click Execute.
View Results:
Review the retrieved messages, including details such as status and timestamps.
c. Send a Message
Find the Endpoint:
Locate the
POST /conversations/{id}/sendendpoint in Swagger.
Test the Request:
Click Try it out.
Paste the Conversation ID.
Enter the message content (e.g., Hello, my name is Den).
Click Execute.
Confirm Message Sent:
Review the response to ensure the message was successfully sent.
d. Verify Messages Sent
Retrieve Recent Messages:
Use the
GET /conversations/{id}/messagesendpoint to confirm the message appears in the conversation timeline.
Execute the Request:
Specify the Conversation ID and click Execute.
Review the response to confirm the new message is listed.
4. Additional Notes
Use filters like date or message count to refine your requests.
Always test endpoints in Swagger to verify data before integrating into your application.
Store your personal access token securely, as it grants access to your account data.
Salesmsg Public API Usage with OAuth2 and Postman
This guide walks you through using the Salesmsg Public API with OAuth2 authorization tokens in Postman. You'll learn how to retrieve your token, import the API collection, and perform API operations like fetching conversations, retrieving messages, and sending messages.
1. Retrieve OAuth2 Token
Login to Salesmsg:
Access your Salesmsg account and log in.
Open Developer Tools:
Press F12 to open DevTools in your browser.
Find the Token:
Navigate to the Application tab in DevTools.
Select Local Storage and locate your application storage.
Search for the
tokenkey in the stored data.Copy the token value for use in Postman.
2. Import Salesmsg API Collection into Postman
Method 1: From Swagger JSON
Retrieve Swagger JSON URL:
Go to Settings > Personal Access Token in Salesmsg.
Open the API Documentation in Swagger.
Copy the link to the Swagger JSON file.
Import into Postman:
Open Postman and click Import.
Paste the Swagger JSON URL and click Continue.
Adjust settings if necessary (e.g., change folder organization from "Path" to "Text").
Click Import to load the collection.
Verify Collection:
Ensure all API endpoints are visible in Postman.
Method 2: From Postman Documentation
Access Postman Documentation:
Visit the Salesmsg website, scroll to the footer, and click the API link.
Scroll to the "Useful Links" section and open the Postman documentation link.
Run in Postman:
Click Run in Postman on the documentation page.
Choose to open in the desktop or web version of Postman.
Select a workspace and click Import.
Verify Collection and Environment:
Confirm the collection is imported. If imported via documentation, the environment variables (e.g., base URL, bearer token) are automatically set.
3. Set Environment Variables in Postman
Edit Bearer Token Variable:
In Postman, open the imported environment.
Locate the Bearer Token variable.
Paste the copied token value into the variable field.
Save changes and ensure the variable is updated.
Verify Base URL:
Confirm the Base URL variable is correct (e.g., the Salesmsg API base URL).
4. Perform API Operations
a. Retrieve Conversations
Select Endpoint:
Locate the
GET /conversationsendpoint in Postman.
Set Parameters:
Add filters, such as a date range, to retrieve specific conversations.
Send Request:
Click Send to execute the request.
View Results:
Review the list of conversations, including IDs and details.
b. Retrieve Messages from a Conversation
Get a Conversation ID:
Copy the ID of a specific conversation from the results of the previous step.
Select Endpoint:
Use the
GET /conversations/{id}/messagesendpoint in Postman.
Set Parameters:
Input the Conversation ID and specify parameters (e.g., number of messages to retrieve).
Send Request:
Click Send and review the retrieved messages.
c. Send a Message
Select Endpoint:
Use the
POST /conversations/{id}/sendendpoint in Postman.
Set Parameters:
Enter the Conversation ID.
Add the message body in the request payload (e.g., "Hello, how can I help you?").
Send Request:
Click Send to execute the request.
Confirm Delivery:
Review the response to ensure the message was successfully sent.
d. Verify Sent Messages
Retrieve Recent Messages:
Use the
GET /conversations/{id}/messagesendpoint again to check for the sent message.
Send Request:
Ensure the latest message is displayed in the response data.
5. Additional Notes
Use Postman's filtering options to refine API requests.
Keep your OAuth2 token secure, as it grants access to your account data.
Ensure environment variables (e.g.,
baseURL,bearerToken) are correctly set for seamless API operations.
Frequently Asked Questions
Which Swagger version should I use?
Use version 2.3 of the Swagger UI page.
Are the Postman environment variables set for me?
If you import the collection from the Postman documentation, the environment variables (e.g., base URL, bearer token) are set automatically. Paste your copied token into the Bearer Token variable and confirm the Base URL.
How do I keep my token safe?
Store your token securely, as it grants access to your account data.
Related Articles
Need Help? ✋🏻
Contact us on live chat or send an email to us at [email protected].

