OFAA OAID API v2

This commit is contained in:
Frank Schubert
2026-01-07 14:36:00 +01:00
parent 2912da08ba
commit 8cebb77bf4
5 changed files with 57 additions and 21 deletions
@@ -27,18 +27,17 @@ $headers = [
];
$confirm_url = str_replace("{oaid}", $oaid, $ep_confirm_oaid);
$out = putRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
if($output == "__err__401") {
$out = patchRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
if($out == "__err__401") {
$access_token = fetchAccessToken($oauth_url, $client_id, $client_secret, $default_scope);
$headers = [
"Authorization: Bearer $access_token",
"Accept: application/json",
"Content-type: application/json",
];
$out = putRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
$u++;
$out = patchRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
}
echo "$oaid_name confirmed.\n";
echo "$oaid confirmed.\n";