Important: Some websites, such as and, allow you to issue REST API requests for testing. (Check the app store for your browser to find testing tools.) For Mozilla Firefox there are REST Client (Link opens in a new window) and REST Easy (Link opens in a new window). Some popular apps for testing REST APIs in Google Chrome are Postman (Link opens in a new window), Advanced REST client (Link opens in a new window), and Rest Web Service Client (Link opens in a new window). You can also test REST calls by using add-ins or extensions in your browser. The command includes a value for the X-Tableau-Auth header, which you pass using the -H option.Ĭurl 3.22/sites/9a8b7c6d5-e4f3-a2b1-c0d9-e8f7a6b5c4d/users/ -H "X-Tableau-Auth:12ab34cd56ef78ab90cd12ef34ab56cd" Using browser-based options to test The following example shows a cURL command that gets a list of users from a site. Command-line utilities typically let you set header values for the request. Most Tableau Server REST API requests require a header named X-Tableau-Auth that includes the authentication token that’s returned by a call to the Sign In If you want to capture the output, you can typically redirect the command to a file, as in the following example:Ĭurl 3.22/auth/signin -X POST -d > restapi-output.txt The return values for requests that you issue at the command line are displayed on the command line. You can specify the HTTP verb ( GET, POST, PUT, DELETE, etc.) by using the -X option.Ĭurl 3.22/auth/signin -X POST -d following is the content of the sigin.xml file that's referenced by the -d option: An easy way to pass XML is to create it in a text file and then reference the text file in the cURL command by using the -d option. The command requires you to pass XML information in the body of the request. The following example shows a cURL command that signs in to the server. Using command-line utilities to testĪnother option for testing REST API calls is to make requests using a tool like cURL (Link opens in a new window) or Wget (Link opens in a new window). However, if you just want to experiment with API calls, you can quickly make REST calls using various tools that let you set the HTTP header and body values, issue a request, and then see the results. Usually, you make REST API calls to Tableau Server by writing a program in Python, Ruby, Java, C#, or other programming language that supports HTTP requests.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |