Я хочу использовать Autodesk Forge Viewer API в моем приложении php для просмотра файлов ifc, поэтому я использовал forge-php-client sdk.everything работает нормально, но работа по переводу не работает, и я получаю эту ошибку: [404] Ошибка подключения к API (https://developer.api.autodesk.com/modelderivative/v2/designdata/job здесь код:
/step1
Configuration::getDefaultConfiguration()
->setClientId('xxxxxxxxxxxxxxxxxxxxxx')
->setClientSecret('xxxxxxxxxxxxxxxxxx');
$twoLeggedAuth = new TwoLeggedAuth();
$twoLeggedAuth->setScopes( [ 'bucket:create' ] );
$twoLeggedAuth->fetchToken();
$tokenInfo = [
'accessToken' => $twoLeggedAuth->getAccessToken(),
'expiry' => time() + $twoLeggedAuth->getExpiresIn(),
];
//step2
$twoLeggedAuth->setScopes( [ 'bucket:create' ] );
$twoLeggedAuth->fetchToken();
$apiInstance = new BucketsApi( $twoLeggedAuth );
$bucket_info = array(
'bucket_key' => 'nebnibim5'.time(),
'policy_key' => 'transient'
);
$post_buckets = new PostBucketsPayload( $bucket_info );
$result = $apiInstance->createBucket( $post_buckets, null );
$twoLeggedAuth = new TwoLeggedAuth();
$twoLeggedAuth->setScopes( [ 'data:write' ] );
$twoLeggedAuth->fetchToken();
$apiInstance = new ObjectsApi( $twoLeggedAuth );
$bucket_key = $bucket_info['bucket_key'];
$filename = 'C:\wamp\www\nebnibim\storage\app\bibliothequeObjets\user69\13111006_IFCR2_Geo_Openings_1.ifc ';
$body = $filename;
$file = new SplFileObject( $body );
$content_length = $file->getSize();
$object_name = $file->getFilename();
//try {
$result2 = $apiInstance->uploadObject( $bucket_key, $object_name, $content_length, $body, null, null );
//step4
$urn = 'urn:adsk.objects:os.object:nebnibim51548575979/13111006_IFCR2_Geo_Openings_1.ifc';
$base64Urn = rtrim( strtr( base64_encode( $urn ), '+/', '-_' ), '=' );
$twoLeggedAuth->setScopes( [ 'data:read', 'data:write' ] );
$twoLeggedAuth->fetchToken();
$apiInstance2 = new DerivativesApi( $twoLeggedAuth );
$jobInput = array(
'urn' => 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bmVibmliaW01MTU0ODU3NTk3OS8xMzExMTAwNl9JRkNSMl9HZW9fT3BlbmluZ3NfMS5pZmM'
);
$jobPayloadInput = new JobPayloadInput( $jobInput );
$jobOutputItem = array(
'type' => 'svf',
'views' => array( '2d', '3d' )
);
$jobPayloadItem = new JobPayloadItem( $jobOutputItem );
$jobOutput = [
'formats' => array( $jobPayloadItem )
];
$jobPayloadOutput = new JobPayloadOutput( $jobOutput );
$job = new JobPayload();
$job->setInput( $jobPayloadInput );
$job->setOutput( $jobPayloadOutput );
$x_ads_force = false;
$resultat= $apiInstance2->translate( $job,$x_ads_force );