Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Requesting oauth2 token return error invalid client id

I need to integrate an API service that uses OAuth 2.0 but is not listed in the dropdown under Project > Manage Oauth.

Following this post [[https://redshiftsupport.matillion.com/customer/portal/articles/2877639?b_id=8915]] I wanted to create 2 API query objects: one to obtain the access token and the other to make the actual "data" call.

I'm stuck at the first RSD already which looks like this:
{{
<rsb:script xmlns:rsb="http://www.rssbus.com/ns/rsbscript/2/">

<rsb:info title="Token example" desc="Get refresh Token" >

<!-- Column definitions -->
<attr name="token" xs:type="string" other:xPath="token" />
</rsb:info>

<rsb:set attr="Header:Name#" value="Accept" />
<rsb:set attr="Header:Value#" value= "application/json" />
<rsb:set attr="Header:Name#" value="OAuth Client Id" />
<rsb:set attr="Header:Value#" value="abc"/>
<rsb:set attr="Header:Name#" value="OAuth Client Secret" />
<rsb:set attr="Header:Value#" value="12345"/>

<rsb:set attr="uri" value="https://rest.cleverreach.com/oauth/authorize.php" />
<rsb:set attr="RepeatElement" value="" />

<rsb:script method="GET" >
<rsb:call op="jsonproviderGet">
<rsb:push/>
</rsb:call>
</rsb:script>
</rsb:script>
}}

Testing this bit in the "Configure API Profile" throws the following error:
Exception testing table. {"error":"invalid_client","error_description":"No client id supplied"}

Can anyone help me with the basic setup of this in Matillion? Why do I get this error? The names of the Headers I got from here: https://redshiftsupport.matillion.com/customer/portal/articles/2916673-api-query-data-model#header1

Thanks a lot in advance

3 Community Answers

Matillion Agent  

Kalyan Arangam —

Hi stefanie,

You are passing the parameters as headers. I don’t think that’s the right way to do it. The example shows those parameters being sent as part of a POST request.

Please try and replicate the request using a tool like curl or postman and then we can help you to replicate that request in an API query.

Best
Kalyan


stefanie niemzok —

Hi Kalyan,

in Postman it was fairly straightforward using their interface. I tried to export it and that's the result

{
"info": {
"_postman_id": "asdfjkl",
"name": "username",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "clevrReach",
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": ""
}
},
"response": []
},
{
"name": "https://rest.cleverreach.com/v2/reports.json",
"request": {
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "accessToken",
"value": "abc123",
"type": "string"
},
{
"key": "tokenType",
"value": "bearer",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "https://rest.cleverreach.com/v2/reports.json",
"protocol": "https",
"host": [
"rest",
"cleverreach",
"com"
],
"path": [
"v2",
"reports.json"
]
}
},
"response": []
}
]
}

Yet, this seems to be the part where the token is already there...
Best,
Steffi


Matillion Agent  

Kalyan Arangam —

Hi Steffi,

Thanks for the update and good to know you are comfortable using Postman.

The response seems to show the syntax usage for their API rather than the response of a login request. Are you able to issue a Login request in Postman and then share the “cURL Code” for the same with us?
Postman UI has a “Code” option/button you can click that then shows how to issue the request in various tools/languages. I am keen on the CURL tool.

It would help understand the complete request you’ve configured. Needless to say, please replace any clientid/Secret/Password in the syntax with XXXXXX. :)

Best
Kalyan

Post Your Community Answer

To add an answer please login