Approvals
Approve posts
Approves up to 100 posts that are waiting for approval. Each one is scheduled for its time. Posts that can’t be approved are listed in failed with the reason.
POST
/
posts
/
approve
Approve posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9']})
};
fetch('https://api.postploy.com/public/v1/posts/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.postploy.com/public/v1/posts/approve"
payload = { "ids": ["3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"approved": [
{
"id": "3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9",
"status": "scheduled",
"statusGroup": "scheduled",
"blockedReason": null,
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"platform": "linkedin",
"title": null,
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"thread": null,
"scheduledAt": "2030-01-15T09:00:00.000Z",
"timezone": "Europe/London",
"acceptedAt": null,
"publishedAt": null,
"deletedAt": null,
"link": null,
"failureReason": null,
"failureKind": null,
"sentBack": null,
"review": null,
"attempts": 0,
"mediaIds": [],
"media": [],
"platformFields": null,
"conversationId": null,
"seriesId": null,
"createdAt": "2030-01-10T12:00:00.000Z",
"actions": {
"edit": true,
"approve": false,
"reject": false,
"retry": false,
"delete": true
}
}
],
"failed": []
}
}{
"statusCode": 400,
"message": "Scheduled date and time must be in the future",
"errors": [
{
"message": "Scheduled date and time must be in the future",
"path": [
"posts",
0,
"scheduledAt"
],
"cause": "custom"
}
],
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/posts"
}{
"statusCode": 401,
"message": "Invalid API key",
"errors": null,
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/accounts"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}Authorizations
Body
application/json
⌘I
Approve posts
curl --request POST \
--url https://api.postploy.com/public/v1/posts/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9']})
};
fetch('https://api.postploy.com/public/v1/posts/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.postploy.com/public/v1/posts/approve"
payload = { "ids": ["3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"approved": [
{
"id": "3f6c2a1b-9d8e-4f7a-b6c5-d4e3f2a1b0c9",
"status": "scheduled",
"statusGroup": "scheduled",
"blockedReason": null,
"socialAccountId": "5b0f4c3e-8a2d-4c51-9e7a-1d2f3a4b5c6d",
"platform": "linkedin",
"title": null,
"text": "Our spring blend is here. Bright, citrusy and roasted this week.",
"thread": null,
"scheduledAt": "2030-01-15T09:00:00.000Z",
"timezone": "Europe/London",
"acceptedAt": null,
"publishedAt": null,
"deletedAt": null,
"link": null,
"failureReason": null,
"failureKind": null,
"sentBack": null,
"review": null,
"attempts": 0,
"mediaIds": [],
"media": [],
"platformFields": null,
"conversationId": null,
"seriesId": null,
"createdAt": "2030-01-10T12:00:00.000Z",
"actions": {
"edit": true,
"approve": false,
"reject": false,
"retry": false,
"delete": true
}
}
],
"failed": []
}
}{
"statusCode": 400,
"message": "Scheduled date and time must be in the future",
"errors": [
{
"message": "Scheduled date and time must be in the future",
"path": [
"posts",
0,
"scheduledAt"
],
"cause": "custom"
}
],
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/posts"
}{
"statusCode": 401,
"message": "Invalid API key",
"errors": null,
"timestamp": "2030-01-10T12:00:00.000Z",
"route": "/public/v1/accounts"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}{
"statusCode": 123,
"message": "<string>",
"errors": [
{
"message": "<string>",
"path": [
"<string>"
],
"cause": "<string>",
"code": "<string>",
"platform": "<string>"
}
],
"timestamp": "2023-11-07T05:31:56Z",
"route": "<string>"
}