All URIs are relative to https://api.sendx.io/api/v1/rest
| Method | HTTP request | Description |
|---|---|---|
| createPost | POST /post | Create blog post |
| deletePost | DELETE /post/{identifier} | Delete post |
| getAllPosts | GET /post | Get all posts |
| getPost | GET /post/{identifier} | Get post by ID |
| updatePost | PUT /post/{identifier} | Update post |
RestRPost createPost(restEPost)
Create blog post
Creates a new blog post.
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.PostApi();
let restEPost = {"name":"launch_draft_2025","postTitle":"Upcoming Product Launch"}; // RestEPost |
apiInstance.createPost(restEPost).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| restEPost | RestEPost |
- Content-Type: application/json
- Accept: application/json
MessageResponse deletePost(identifier)
Delete post
Soft deletes a blog post. 🎯 Key Features: - Soft delete - Preserve data - Remove from listings
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.PostApi();
let identifier = "contact_BnKjkbBBS500CoBCP0oChQ"; // String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
apiInstance.deletePost(identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: Not defined
- Accept: application/json
[RestRPost] getAllPosts(opts)
Get all posts
Retrieves all blog posts with pagination. 🎯 Key Features: - Filter by status - Search functionality - Sort options - Include metadata
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.PostApi();
let opts = {
'offset': 0, // Number | Number of posts to skip
'limit': 10 // Number | Maximum number of posts to return
};
apiInstance.getAllPosts(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| offset | Number | Number of posts to skip | [optional] [default to 0] |
| limit | Number | Maximum number of posts to return | [optional] [default to 10] |
- Content-Type: Not defined
- Accept: application/json
RestRPost getPost(identifier)
Get post by ID
Retrieves a specific blog post. 🎯 Key Features: - Full post content - SEO metadata - Related posts - Engagement metrics
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.PostApi();
let identifier = "contact_BnKjkbBBS500CoBCP0oChQ"; // String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
apiInstance.getPost(identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: Not defined
- Accept: application/json
RestRPost updatePost(restEPost, identifier)
Update post
Updates an existing blog post. 🎯 Key Features: - Edit content - Update metadata - Change status - Modify tags/categories
import sendx from 'sendx-javascript-sdk';
let defaultClient = sendx.ApiClient.instance;
// Configure API key authorization: TeamApiKey
let TeamApiKey = defaultClient.authentications['TeamApiKey'];
TeamApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//TeamApiKey.apiKeyPrefix = 'Token';
let apiInstance = new sendx.PostApi();
let restEPost = new sendx.RestEPost(); // RestEPost |
let identifier = "contact_BnKjkbBBS500CoBCP0oChQ"; // String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) **Format:** `<prefix>_<22-character-id>`
apiInstance.updatePost(restEPost, identifier).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| restEPost | RestEPost | ||
| identifier | String | Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`) Format: `<prefix>_<22-character-id>` |
- Content-Type: application/json
- Accept: application/json