Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to use Tableau's graphql to read metadata from our Tableau Online instance.
My Tableau graphql is:
query getWorkbooks {workbooks {id, name, projectName, projectVizportalUrlId}}
I've tested it on https://us-east-1.online.tableau.com/metadata/graphiql and I get back the expected results.
I also created a Personal Authentication Token on Tableau Online which I need to pass in the body of the
tRESTClient
and that's where I'm struggling. It can either be passed as an XML or JSON.https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_auth.htm
The XML request body (message payload) using a Personal Access Token looks like the following example. The header of the request should contain either the key value pair
Content-Type
:text/xml
, orContent-Type
:application/xml
.<
tsRequest
>
<
credentials
personalAccessTokenName
=
"MY_TOKEN_NAME"
personalAccessTokenSecret
=
"qlE1g9MMh9vbrjjg==:rZTHhPpP2tUW1kfn4tjg8"
>
<
site
contentUrl
=
"MarketingTeam"
/>
</
credentials
>
</
tsRequest
>
The same request body using JSON looks like the following. Its header should contain
Content-Type
:application/json
.{
"credentials"
: {
"personalAccessTokenName"
:
"MY_TOKEN_NAME"
,
"personalAccessTokenSecret"
:
"qlE1g9MMh9vbrjjg==:rZTHhPpP2tUW1kfn4tjg8"
,
"site"
: {
"contentUrl"
:
"MarketingTeam"
}
}
}
How would I construct the above in Talend and pass to the tRESTClient body?
Hi
Take a look at tXMLMap component where you can build a Document as body and pass it to tRestClient, the job design looks like:
tFixeFlowInput--main--tXMLMap--out1-->tRestClient--main--tLogRow
Regards
Shong