Connect account
curl --request POST \
--url https://postonce.to/api/public/v1/accounts/connect/{platform} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "<string>",
"redirect_url": "<string>"
}
'import requests
url = "https://postonce.to/api/public/v1/accounts/connect/{platform}"
payload = {
"external_user_id": "<string>",
"redirect_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_user_id: '<string>', redirect_url: '<string>'})
};
fetch('https://postonce.to/api/public/v1/accounts/connect/{platform}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://postonce.to/api/public/v1/accounts/connect/{platform}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_user_id' => '<string>',
'redirect_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://postonce.to/api/public/v1/accounts/connect/{platform}"
payload := strings.NewReader("{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://postonce.to/api/public/v1/accounts/connect/{platform}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://postonce.to/api/public/v1/accounts/connect/{platform}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"hosted_url": "https://postonce.to/dashboard/accounts?connect=twitter&source=public_api",
"authorization_url": "https://www.tiktok.com/v2/auth/authorize/?client_key=...",
"mode": "oauth_authorization_url",
"platform": "twitter"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}Accounts
Connect account
Computes a five-minute browser authorization URL bound to the authenticated profile without connecting or changing an account. The provider is authorized when the user opens the returned URL in their own browser; the account is connected once that flow finishes. Depending on platform, the browser uses provider OAuth or a PostOnce-hosted credential or signer flow, so provider credentials are entered only on that page. Partner accounts may send external_user_id and an allowed redirect_url; after consent the end user is redirected to redirect_url with status, account_id, platform and external_user_id (or error).
POST
https://postonce.to/api/public
/
v1
/
accounts
/
connect
/
{platform}
Connect account
curl --request POST \
--url https://postonce.to/api/public/v1/accounts/connect/{platform} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"external_user_id": "<string>",
"redirect_url": "<string>"
}
'import requests
url = "https://postonce.to/api/public/v1/accounts/connect/{platform}"
payload = {
"external_user_id": "<string>",
"redirect_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({external_user_id: '<string>', redirect_url: '<string>'})
};
fetch('https://postonce.to/api/public/v1/accounts/connect/{platform}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://postonce.to/api/public/v1/accounts/connect/{platform}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'external_user_id' => '<string>',
'redirect_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://postonce.to/api/public/v1/accounts/connect/{platform}"
payload := strings.NewReader("{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://postonce.to/api/public/v1/accounts/connect/{platform}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://postonce.to/api/public/v1/accounts/connect/{platform}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"external_user_id\": \"<string>\",\n \"redirect_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"hosted_url": "https://postonce.to/dashboard/accounts?connect=twitter&source=public_api",
"authorization_url": "https://www.tiktok.com/v2/auth/authorize/?client_key=...",
"mode": "oauth_authorization_url",
"platform": "twitter"
}
}{
"error": {
"code": "invalid_api_key",
"message": "Invalid API key.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}{
"error": {
"code": "workflow_limit_reached",
"message": "You have reached the maximum number of workflows for your plan.",
"hint": "<string>"
}
}Authorizations
Path Parameters
Body
application/json
