SUMguy
SUMguy

Reputation: 1673

Azure Data Factory - "Invalid format" error

I have a 1-step pipeline in ADF which is a single "Web activity" which sends a GET request to a simple REST API. The complete definition is as follows:

URL : https://allstate.myabsorb.com/api/rest/v1/ecommerce/transactions?transactiondate=2021-01-11

Method : GET

Headers

Authorization : xyz/123+abc123==

Content-Type : application/json

When I execute this request via Postman, the request is successful. However, when I send the same request via Web Activity in Azure Data Factory, I receive the following error message:

Error calling the endpoint 'https://allstate.myabsorb.com/api/rest/v1/ecommerce/transactions?transactiondate=2021-01-11'. Response status code: ''. More details:Exception message: 'The format of value 'xyz/123+abc123==' is invalid.'. No response from the endpoint. Possible causes: network connectivity, DNS failure, server certificate validation or timeout.

Through testing I've discovered that if I remove both the equal sign ( = ) and the forward slash ( / ) from the Authorization string, I do receive a valid response from the API:

{"Message":"Authorization has been denied for this request."}

This is great. This is the expected response I'm looking for (note that ADF still considers this an error, but this is the desired output) The problem is that in practice I cannot remove these characters from the string because then the token is invalid which means I cannot gain access to the API... I need a way to modify the Authorization string to the correct "type" without changing the value.

Is there a way to allow special characters in my Authorization string for this REST API call?


This is what the result should look like: enter image description here


This is what the successful result looks like in Postman

enter image description here

Upvotes: 2

Views: 1899

Answers (2)

PabloWeb18
PabloWeb18

Reputation: 411

After tryng to create a call a make like this

enter image description here

So try to do with authorization token

the answer that I get was

{"validations":{},"code":500.0,"message":"An unexpected error occurred.","term":"ErrorGeneric","_meta":{"status":500}}

Upvotes: 0

Joy Wang
Joy Wang

Reputation: 42043

To solve the issue, just add Basic in front of xyz/123+abc123==, the header should be:

Authorization : Basic xyz/123+abc123==

Note there is a space between Basic and xyz/123+abc123==, then it will work fine.

enter image description here

Upvotes: 2

Related Questions