Derivative Service 400 Bad Request - autodesk

Sometimes when accessing the Forge Derivative Service API via
GET https://developer.api.autodesk.com/derivativeservice/v2/manifest/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6c3RlbW4vNTcwMzBkMzBjNzFkZWVmNDBkNjViNDAxLTBCOTlVamtJMXBnN2FkbE16UzJKSExVbzNjV3MtMEI5OVVqa0kxcGc3YWRHOTJlbVJtTnpablJ6TnhRV2N5V1hOT05qZEdPV2xwYVhoclBRLXVuZGVmaW5lZC5kd2c
I get the response
<HTML><HEAD>
<TITLE>Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Reference #7.425832b8.1500624784.0
</BODY>
</HTML>
How can I find out what it was about my request that the server did not understand. This is a simple GET request so I'm not sure what I am doing so that my request is not understood.

First, there is no endpoint like you are describing (see list): derivativeservice/v2/manifest/:urn doesn't exist, aren't you missing something? Which endpoint are you trying to call? Maybe manifest?
Second, when I base64 DECODE your URN, I'm getting:
urn:adsk.objects:os.object:stemn/57030d30c71deef40d65b401-0B99UjkI1pg7adlMzS2JHLUo3cWs-0B99UjkI1pg7adG92emRmNzZnRzNxQWcyWXNONjdGOWlpaXhrPQ-undefined.dwg
This undefined at the end is a bit suspicious and may be causing this problem. Can you double check the URN before encoding it? If that's a file on a bucket, seems incomplete/incorrect anyway.

Related

Banno Admin API for External Transfers

I am having an issue calling External Transfer Settings API. I tested other APIs and was able to get a response. Below is the URI I used for External Transfers.
https://banno.com/a/transfer-settings/api/v0/institutions/xxxx/xxxxxxx/transfer/settings/external
and the response I got is 'Cannot PUT /a/transfer-settings/api/v0/institutions/xxxx/xxxxx/transfer/settings/external'
1) Which endpoint is the the one that is failing?
The /xxxx/xxxxx/ makes it a bit ambiguous if this is the Institution External Transfer Settings endpoint (PUT /a/transfer-settings/api/v0/institutions/{institutionId}/transfer/settings/external or if it is the User External Transfer Settings endpoint (PUT /a/transfer-settings/api/v0/institutions/{institutionId}/users/{userId}/transfer/settings/external
2) Can you provide the full error response?
The error response will have an HTTP status code (which is helpful), a response body, and a header x-request-id (which is also helpful) to understand what is occurring.

iTunes Store Customer Reviews API XML Endpoint Broken

I used to use the XML endpoint because it provided review dates for each review called 'updated'. This is not contained in the JSON endpoint. However, the XML endpoint stopped working. I get the error seen below:
Web Server Error
Description: The host did not return the document correctly.
Has anyone experienced the same issue? Any workarounds? Do you anticipate this will ever be fixed by Apple? Do you think the JSON endpoint might be taken down any time soon?
XML Endpoint (Broken)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/xml
JSON Endpoint (Working)
https://itunes.apple.com/us/rss/customerreviews/id=1145275343/mostrecent/json
It appears the XML endpoint is up and running again. No more Web Server Error. Hopefully the endpoint stays up.

CORS headers missing from response when POST with invalid JSON in AWS Api Gateway API

We have an AWS API Gateway API that works for CORS most of the time. The only exception is when POSTing with invalid JSON, when CORS headers are missing from the response. If it is a valid JSON but it fails data validation, then the CORS headers are correctly set. I tried to reset the root resource by 'enable CORS' for root resource and redeploy, the same situation.
Just wondering if anyone has seen this before and how to fix it. Thanks
found the answer myself. If APIG has not reached integration in this case, need to customize the gateway response
https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html

unexpected token : from angular $http.jsonp request to Instagram API

I'm making a request to an authorized Instagram account to display images on a site. Originally, I was running into No 'Access-Control-Allow-Origin' when using Angular's $http.get(....
From Matt's answer in this question, It seems that I can use getJSON, or Angular $http.jsonp, to bypass this issue. That Guy's answer also says "JSONP is really a simply trick to overcome XMLHttpRequest same domain policy".
So, I'm no longer getting that problem, and am getting a json payload:
{"pagination":{"next_url":"https:\/\/api.instagram.com... etc
But am getting a very ambiguous error:
Uncaught SyntaxError: Unexpected token :
This is a response from the Instagram API, so I'm not sure why there'd be a syntax error on the inbound json. Also, It's hard to locate the error since the jsonp response is all on a single line... where the error is reported.
The preview shows that I'm getting a full payload:
I found the issue. Unfortunately there are no JavaScript libraries to help with this, but in the Instagram API docs, for JSONP you can wrap the response with a callback so that the json payload will be wrapped in <script> tags (more info on jsonp here), therefore not blocked by Access Control Allow Origin.
https://api.instagram.com/v1/tags/coffee/media/recent?access_token=ACCESS-TOKEN&callback=callbackFunction
Response:
callbackFunction({
...
});
So, in your http request URI, you add in a callback parameter. Since I am using Angular, their docs for $http.jsonp() requests specify the callback string as "JSON_CALLBACK".
So, my request URL for Angular would be:
$http.jsonp(
'https://api.instagram.com/v1/tags/coffee/media/recent?
access_token=ACCESS-TOKEN&callback=JSON_CALLBACK')
.success(function(data) {...

JSONP cross-domain request error

Is there a way to get response status when doing JSONP request. I mean, can I see if it was a successful request 200 OK, or not found 404, or not available, etc. ?
ALTERNATIVELY: Maybe there is a way to try to load .js file using new Image() object, i.e. assuming it is an image and then see the response status? Or try to load even something completely different?
Is there any JavaScript cross-domain way to check if a resource is available or 404 unavailable?
May be that library can be helpful:
https://github.com/jaubourg/jquery-jsonp