Skip to content

Instantly share code, notes, and snippets.

View JordanSchuetz's full-sized avatar
😍
Coding

Jordan Schuetz JordanSchuetz

😍
Coding
View GitHub Profile
%dw 2.0
import dw::module::Multipart
output multipart/mixed boundary="-----az1by2cx34dw"
---
{
"parts": {
"file":{
"headers" : {
"Content-Type" : "text/xml",
"Content-Disposition" : {
output application/java
---
{
"siteId" : vars.setSiteId,
“uploadSessionId”: vars.uploadSessionId
}
%dw 2.0
import dw::module::Multipart
output multipart/mixed boundary="-----az1by2cx34dw"
---
{
"parts": {
"file" : {
"headers" : {
"Content-Type" : "application/octet-stream",
"Content-Disposition" : {
%dw 2.0
output application/java
ns ns0 http://tableau.com/api
---
payload.ns0#tsResponse.ns0#fileUpload.@uploadSessionId
output application/xml
---
{
tsRequest: {
user @(
name: vars."user-name",
siteRole: vars.role
): null
}
}
output application/java
---
{
"siteId" : vars.setSiteId
}
output application/java
---
{
"x-tableau-auth" : vars.setAuthToken
}
%dw 2.0
output application/java
ns ns0 http://tableau.com/api
---
payload.ns0#tsResponse.ns0#credentials.@token
%dw 2.0
output application/java
ns ns0 http://tableau.com/api
---
payload.ns0#tsResponse.ns0#credentials.ns0#site.@id
<tsRequest>
<credentials
personalAccessTokenName="XXXX"
personalAccessTokenSecret="XXXXXXXXXXXXXXX >
<site contentUrl="myhelloworldsite" />
</credentials>
</tsRequest>