API Query Profile - 401 Unauthorized Error

I'm setting up an API query profile and running into an error at the very end of the process. Everything checks out at Step 2 (Endpoint Config).. My API validates successfully and I can see the API response.

 

I don't make any changes in Step 3 (Response Config) but when I make it to Step 4 (Review), the Data Preview tab returns an error: 'Exception testing table. HTTP protocol error. 401 Unauthorized.'

 

Why would it return an error here when it validated successfully before? It throws the same error if I try to add it to an Orchestration job. As far as I can tell, the API documentation doesn't mention a 401 error so it seems to me this is something with Matillion and not the API. What am I missing?

Hi Austin,

 

I've used API Query on a few different endpoints, but have not hit that problem before. I would guess that between steps 2 and 4 there's got to be some difference in the way it sends the HTTP request.

 

What kind of authorization are you using in step 2? Are you setting some Params manually, or are you using the Auth tab? Also, are you using any variables in either of those two places? (In which case try hardcoding them temporarily just to see if that's the root cause).

 

The API Query / API Extract functionality is one of the newer features according to the release notes, so I would also check.. are you on the latest version (Help / About)?

 

BR

Thanks @deBaris​! Sorry for the late reply but I wanted to follow up here. Your response, along with some help from the vendor who's API I'm using, helped me figure this out.

For anyone else running into this same issue.. For my authentication, I was passing an API key via a header in the Params tab. Like I mentioned, the request was successful when I went to test it, but then it would fail in the review screen of the configuration profile. The resolution here was to move my authentication to the Auth tab and use the API Key:Value option. The other API I set up before this one let me use it in the Params tab so I guess it varies from API to API!

Thanks again @deBaris​!

Austin