OFAA OAID API v2
This commit is contained in:
@@ -37,7 +37,7 @@ $u = 0;
|
||||
echo "Creating and confirming $batch_size version ".$content['version']." OAIDs for tenant ".$content['tenant']."\n";
|
||||
|
||||
for($i = 0; $i < $batch_size; $i++) {
|
||||
$content['external_id'] = guidv4();
|
||||
$content['customer_reference'] = guidv4();
|
||||
|
||||
$output = postRestUrl($ep_request_oaid, $headers, $content, "application/json");
|
||||
if($output == "__err__401") {
|
||||
@@ -61,16 +61,16 @@ for($i = 0; $i < $batch_size; $i++) {
|
||||
$c++;
|
||||
|
||||
$oaid = $output_json->oaid;
|
||||
$tenant = $output_json->tenant;
|
||||
//$tenant = $output_json->tenant;
|
||||
$token = $output_json->token;
|
||||
$status = $output_json->status;
|
||||
$external_id = $output_json->external_id;
|
||||
$customer_reference = $output_json->customer_reference;
|
||||
|
||||
//echo "oaid: $oaid, tenant: $tenant, token: $token, status: $status, external_id: $external_id\n";
|
||||
|
||||
if($token == "requested") {
|
||||
$confirm_url = str_replace("{oaid}", $oaid, $ep_confirm_oaid);
|
||||
$out = putRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
|
||||
$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 = [
|
||||
@@ -78,7 +78,7 @@ for($i = 0; $i < $batch_size; $i++) {
|
||||
"Accept: application/json",
|
||||
"Content-type: application/json",
|
||||
];
|
||||
$out = putRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
|
||||
$out = patchRestUrl($confirm_url, $headers, ["token" => "confirmed"], "application/json");
|
||||
}
|
||||
echo ".";
|
||||
$u++;
|
||||
|
||||
Reference in New Issue
Block a user