Voici le morceau de code exemple pour faire des post Mastodon via PHP :

<?php
$headers = [
'Authorization: Bearer TACLEAPIQUETURECUPERESURTONCOMPTE'
];
$status_data = array(
“status” ⇒ “Contenu de ton pouet ”,
“language” ⇒ “fra”,
“visibility” ⇒ “public”
);
$ch_status = curl_init();
curl_setopt($ch_status, CURLOPT_URL, “https://toninstancemastodon.org/api/v1/statuses”);
curl_setopt($ch_status, CURLOPT_POST, 1);
curl_setopt($ch_status, CURLOPT_POSTFIELDS, $status_data);
curl_setopt($ch_status, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch_status, CURLOPT_HTTPHEADER, $headers);
$output_status = json_decode(curl_exec($ch_status));
curl_close ($ch_status);
?>