forge-php-client icon indicating copy to clipboard operation
forge-php-client copied to clipboard

Cannot Post a Job. Exception when calling DerivativesApi->translate: [404] Error connecting to the API (https://developer.api.autodesk.com/modelderivative/v2/designdata/job)

Open sadaimudiNaadhar opened this issue 6 years ago • 1 comments

The job endpoint is returning following exception. Exception when calling DerivativesApi->translate: [404] Error connecting to the API (https://developer.api.autodesk.com/modelderivative/v2/designdata/job)

Did you removed this endpoint? Anyone you please help on this issue. We are working on a project that integrates this API.

Code

$apiInstance = new Autodesk\Forge\Client\Api\DerivativesApi( $twoLeggedAuth );

$jobInput = array(
  'urn' => // my base 64 urn
);
$jobPayloadInput = new Autodesk\Forge\Client\Model\JobPayloadInput( $jobInput );

$jobOutputItem = array(
  'type' => 'svf',
  'views' => array( '2d' )
);
$jobPayloadItem = new Autodesk\Forge\Client\Model\JobPayloadItem( $jobOutputItem );

$jobOutput = [
  'formats' => array( $jobPayloadItem )
];
$jobPayloadOutput = new Autodesk\Forge\Client\Model\JobPayloadOutput( $jobOutput );

$job = new \Autodesk\Forge\Client\Model\JobPayload();
$job->setInput( $jobPayloadInput );
$job->setOutput( $jobPayloadOutput );
$x_ads_force = false;   //!<<`true`: the endpoint replaces previously translated output file types with the newly generated derivatives,  `false` (default): previously created derivatives are not replaced

try {
    $result = $apiInstance->translate( $job, $x_ads_force );

    print_r( $result );  //!<< Print job request response from the Model Derivative API.
} catch( Exception $e ) {
    echo 'Exception when calling DerivativesApi->translate: ', $e->getMessage(), PHP_EOL;
}

sadaimudiNaadhar avatar May 28 '19 07:05 sadaimudiNaadhar

What is the retention policy of your bucket? By default objects will only be kept for 24 hours - see here

dukedhx avatar Jun 18 '19 07:06 dukedhx