Admin post handler for creating custom sages
curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data action=create_custom_sage \
--data council_id=3c90c3cc-0d44-4b50-8888-8dd25736052aimport requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage"
payload = {
"action": "create_custom_sage",
"council_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
action: 'create_custom_sage',
council_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage', 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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage"
payload := strings.NewReader("action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a"
response = http.request(request)
puts response.read_bodySage – CRUD
Admin post handler for creating custom sages
Admin post handler for initiating custom sage creation from the admin panel. Checks council credits and redirects to the sage training workflow or JIT credit purchase page.
Registered as both admin_post_create_custom_sage and
admin_post_nopriv_create_custom_sage — public.
POST
/
wp-admin
/
admin-post.php?action=create_custom_sage
Admin post handler for creating custom sages
curl --request POST \
--url 'https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data action=create_custom_sage \
--data council_id=3c90c3cc-0d44-4b50-8888-8dd25736052aimport requests
url = "https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage"
payload = {
"action": "create_custom_sage",
"council_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
action: 'create_custom_sage',
council_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage', 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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage"
payload := strings.NewReader("action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/wp-json/sagescreen/v1/wp-admin/admin-post.php?action=create_custom_sage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "action=create_custom_sage&council_id=3c90c3cc-0d44-4b50-8888-8dd25736052a"
response = http.request(request)
puts response.read_body⌘I