#!/usr/bin/php 1) { $oaid = $argv[1]; } if(!$oaid) { die("OAID name required\n"); } if(!$access_token) { $access_token = fetchAccessToken($oauth_url, $client_id, $client_secret, $default_scope); if(!$access_token) { die("Error getting access token"); } } $headers = [ "Authorization: Bearer $access_token", "Accept: application/json", "Content-type: application/json", ]; $confirm_url = str_replace("{oaid}", $oaid, $ep_confirm_oaid); $out = putRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json"); if($output == "__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++; } echo "$oaid_name confirmed.\n";