417 Expectation Failed on tableau restapi powershell script

0 votes

I'm new to powershell and trying to make REST API calls to tableau server (version 2018.1) using powershell version 5.1, but I'm getting an issue that I can't seem to fix. The code I'm sending is as follows:

 #Variables:
$sites = 'site'
$APiversion = '3.0'
$DeployPassword = 'Password123'
$DeployUser = 'Defaultuser'
$Tableauservername = 'servername'

# generate body for sign in
$signin_body = (’<tsRequest>
 <credentials name=“’ + $DeployUser + ’” password=“’+ $DeployPassword + ’” >
   <site contentUrl=“” />
 </credentials>
</tsRequest>’)
#[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$response = Invoke-RestMethod -Uri https://$Tableauservername/api/3.0/auth/signin -Body $signin_body -Method post -UseBasicParsing

The following error notice appears:

tion given in the Expect request-header
field could not be met by this server.
The client sent
    Expect: 100-continue

Only the 100-continue expectation is supported.


At line:16 char:13
+ $response = Invoke-RestMethod -Uri https://$Tableauservername/api/3.0 ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Is there anyone who can tell me what I'm doing wrong here?

I've tried changing the formatting of the quotations and such, but it doesn't appear to work.

Apr 25, 2022 in Tableau by Neha
• 9,020 points
957 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Tableau

0 votes
1 answer

How to color code cells of a column based on the text value in Tableau

You can use the following steps to ...READ MORE

answered Mar 27, 2018 in Tableau by Atul
• 10,240 points
9,945 views
0 votes
1 answer
0 votes
1 answer

Is it possible to join tables on the basis of some calculated field in Tableau?

@Ammy999, You can not perform join in the ...READ MORE

answered May 17, 2018 in Tableau by Mathew1810
1,413 views
0 votes
1 answer
0 votes
1 answer

How to hide measures on a Tableau filter?

Number of Records is just a predefined ...READ MORE

answered Jul 11, 2018 in Tableau by ffdfd
• 5,550 points
2,425 views
+1 vote
1 answer

How can I filter data on different sheets based on clicks on Tableau

Filter actions are an essential and fundamental ...READ MORE

answered Jul 20, 2018 in Tableau by ffdfd
• 5,550 points
10,914 views
0 votes
1 answer

Connecting REST API to Tableau

The REST API is not a data ...READ MORE

answered Apr 5, 2022 in Tableau by Neha
• 9,020 points
2,604 views
+6 votes
5 answers

can't remove SSIS variables using remove method on PowerShell

you're missing the additional $environment.Alter() after your ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,300 points
2,671 views
0 votes
1 answer

How to get issues count based on rules in a sonar project?

There are API docs in the footer ...READ MORE

answered May 4, 2018 in Other DevOps Questions by DareDev
• 6,890 points
2,861 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP