{"id":4828,"date":"2018-09-14T19:08:36","date_gmt":"2018-09-14T19:08:36","guid":{"rendered":"https:\/\/zappysys.com\/blog\/?p=4828"},"modified":"2018-09-28T17:34:39","modified_gmt":"2018-09-28T17:34:39","slug":"call-rest-api-powershell-script-export-json-csv","status":"publish","type":"post","link":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/","title":{"rendered":"Call REST API in PowerShell Script &#8211; Export JSON to CSV"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-4839 alignleft\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\" alt=\"\" width=\"97\" height=\"97\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png 256w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo-150x150.png 150w\" sizes=\"(max-width: 97px) 100vw, 97px\" \/><\/a>In this article we will cover how to call REST API in PowerShell and export result to CSV file. If you want to export JSON based API result to file then you have to consider few things. Such as API Authentication, API Pagination, Parsing JSON, Error Handling and many more. Luckily we can use <a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/\" target=\"_blank\" rel=\"noopener\">ODBC Driver like this one<\/a> to call API services and get data from RESTful services using familiar SQL query language.<\/p>\n<p><strong>ZappySys ODBC driver<\/strong> can take care most of details about your API calls and data parsing so you can focus on business problem.<\/p>\n<h2>Requirements<\/h2>\n<p>Before we start step by step tutorial let&#8217;s make sure we have necessary tools installed.<\/p>\n<ol>\n<li>You have PowerShell ISE &#8211; Editor for PowerShell (Search in your Start menu to confirm)<\/li>\n<li>Make sure you have installed <a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/\" target=\"_blank\" rel=\"noopener\">ZappySys ODBC PowerPack<\/a><\/li>\n<\/ol>\n<h2>Getting Started<\/h2>\n<p>Once you have installed <a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/\" target=\"_blank\" rel=\"noopener\">ODBC PowerPack<\/a> we are ready to look at few examples on how to call REST API in PowerShell.<\/p>\n<h3>Example 1 &#8211; Call REST API and Export JSON data to CSV in PowerShell<\/h3>\n<p>Open PowerShell ISE (Editor) and Paste below code. Click<\/p>\n<pre class=\"lang:ps decode:true\">$conn = New-Object System.Data.Odbc.OdbcConnection\r\n$conn.ConnectionString = \"DRIVER={ZappySys JSON Driver}\"\r\n\r\n#--OR-- Use DSN name\r\n#$conn.connectionstring = \"DSN=MyDSNName\"\r\n\r\n$conn.Open()\r\n\r\n# -------------------------------------------------------------------------------\r\n# In powershell $ is special char so we used `$ in below string to escape it. \r\n# Also We used multi string start with \"@&lt;new line&gt; and ends with &lt;new line&gt;\"@\r\n# -------------------------------------------------------------------------------\r\n$sql = \r\n@\"\r\nSELECT * FROM value \r\nWITH (SRC='https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?`$format=json')\r\n\"@\r\n\r\n$cmd = $conn.CreateCommand()\r\n$cmd.CommandText = $sql\r\n\r\n$dataset = New-Object System.Data.DataSet\r\n#Load data in DataSet\r\n(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet)\r\n\r\n#Export datatable to file in CSV format\r\n$dataset.Tables[0] | ConvertTo-csv -NoTypeInformation -Delimiter \"`t\" | Out-File \"c:\\temp\\dump.csv\" -fo\r\n\r\nWrite-Host \"Total rows $($dataSet.Tables[0].Rows.Count)\"\r\n$conn.Close()<\/pre>\n<p>Here is what it will look like once you execute.<\/p>\n<div id=\"attachment_4829\" style=\"width: 835px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-call-rest-api-export-json-to-csv-file-example.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4829\" class=\"size-full wp-image-4829\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-call-rest-api-export-json-to-csv-file-example.png\" alt=\"Example : Call REST API in PowerShell and Export JSON data to CSV File\" width=\"825\" height=\"719\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-call-rest-api-export-json-to-csv-file-example.png 825w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-call-rest-api-export-json-to-csv-file-example-300x261.png 300w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-call-rest-api-export-json-to-csv-file-example-768x669.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/a><p id=\"caption-attachment-4829\" class=\"wp-caption-text\">Example : Call REST API in PowerShell and Export JSON data to CSV File<\/p><\/div>\n<p>&nbsp;<\/p>\n<h3>Example 2 &#8211; Reading REST API data using ODBC DSN (User Interface Mode) in PowerShell<\/h3>\n<p>In previous section we saw simple script which was using DSN less connection string (i.e. DRIVER={xxxxxxx} ).<\/p>\n<p>Now let&#8217;s look at another way to call API (i.e. Use DSN=xxxxx in your connection string). We will use ODBC Driver&#8217;s User Interface to configure various properties. We will also use query preview tool to test your API query. Finally we will use DSN name in Our PowerShell Script.<\/p>\n<p>Advantage of using ODBC DSN is you don&#8217;t have to expose credentials in your PowerShell Script. Also when you have multiple scripts using same connection to query multiple API endpoints it becomes very easy to reuse just DSN name rather than many connection string settings.<\/p>\n<p>So let&#8217;s get started<\/p>\n<ol>\n<li>To do this, we will first open the ODBC Data Source (32 bit):\n<div id=\"attachment_2827\" style=\"width: 403px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2827\" class=\"wp-image-2827 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator.png\" alt=\"Open odbc\" width=\"393\" height=\"531\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator.png 393w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/open-ODBC-Data-souce-administrator-222x300.png 222w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/a><p id=\"caption-attachment-2827\" class=\"wp-caption-text\">Open odbc data source<\/p><\/div><\/li>\n<li>Use the User DSN page and press<strong> Add<\/strong>\n<div id=\"attachment_2765\" style=\"width: 600px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-new-data-source-odbc-administrator.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2765\" class=\"wp-image-2765 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-new-data-source-odbc-administrator.png\" alt=\"New Data source\" width=\"590\" height=\"423\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-new-data-source-odbc-administrator.png 590w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/add-new-data-source-odbc-administrator-300x215.png 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/a><p id=\"caption-attachment-2765\" class=\"wp-caption-text\">Add new data source<\/p><\/div><\/li>\n<li>Add the ZappySys JSON Driver\n<div id=\"attachment_2825\" style=\"width: 471px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2825\" class=\"wp-image-2825 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver.png\" alt=\"Select zappysys JSON Driver (needed for JSON \/ REST Connection)\" width=\"461\" height=\"346\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver.png 461w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/create-new-data-source-zappysys-json-driver-300x225.png 300w\" sizes=\"(max-width: 461px) 100vw, 461px\" \/><\/a><p id=\"caption-attachment-2825\" class=\"wp-caption-text\">Select zappysys JSON Driver (needed for JSON \/ REST API Connection)<\/p><\/div><\/li>\n<li>Name your data source (e.g. in below screenshot its <strong>ZappySys JSON PowerBI<\/strong>). This will be used in our Script to refer in DSN=xxxxxxx for connectionstring.<\/li>\n<li>It is time to connect with OData. In\u00a0<strong>Data Source (URL or File Path),<\/strong> we will use the following URL.\n<pre class=\"lang:php highlight:0 decode:true\">https:\/\/services.odata.org\/V3\/Northwind\/Northwind.svc\/Customers?$format=json<\/pre>\n<p>After URL select Filter (Basically its a setting to flatten your data from selected hierarchy). In our case Filter = <strong>$.value[*]<\/strong><\/p>\n<p><strong>UI Mode (Simple View) &#8211; New Version<\/strong><\/p>\n<div style=\"width: 817px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/zappysys-json-rest-api-driver-properties-import-odata-url.png\" alt=\"Simple View - Configure ZappySys JSON \/ REST API Driver Properties\" width=\"807\" height=\"703\" \/><p class=\"wp-caption-text\">Simple View &#8211; Configure ZappySys JSON \/ REST API Driver Properties<\/p><\/div>\n<p><strong>Grid Mode (Advanced View) &#8211; Old Version<\/strong><\/p>\n<div id=\"attachment_2851\" style=\"width: 608px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/zappysys-json-driver-properties-odata.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2851\" class=\"wp-image-2851 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/zappysys-json-driver-properties-odata.png\" alt=\"Advanced View - ZappySys JSON \/ REST API Driver Properties\" width=\"598\" height=\"551\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/zappysys-json-driver-properties-odata.png 598w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/zappysys-json-driver-properties-odata-300x276.png 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/a><p id=\"caption-attachment-2851\" class=\"wp-caption-text\">Advanced View &#8211; ZappySys JSON \/ REST API Driver Properties<\/p><\/div>\n<p>&nbsp;<\/li>\n<li>We can now generate queries using a format similar to SQL. Click <strong>Select Table<\/strong> and select <strong>value<\/strong>. This option will generate a query to retrieve all the data automatically. Next, press <strong><strong>Preview Data:<\/strong><\/strong><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/select-table-json.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2850 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/select-table-json.png\" alt=\"create json query\" width=\"598\" height=\"275\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/select-table-json.png 598w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/select-table-json-300x138.png 300w\" sizes=\"(max-width: 598px) 100vw, 598px\" \/><\/a><\/li>\n<li>When <strong>Preview<\/strong> is pressed, you can visualize the data.\n<div id=\"attachment_2849\" style=\"width: 607px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/json-information-query-displayed-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-2849\" class=\"wp-image-2849 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/json-information-query-displayed-1.png\" alt=\"Display rest api data\" width=\"597\" height=\"636\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/json-information-query-displayed-1.png 597w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/json-information-query-displayed-1-282x300.png 282w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><\/a><p id=\"caption-attachment-2849\" class=\"wp-caption-text\">Display rest api information<\/p><\/div><\/li>\n<li>You should also review several other examples to learn many other features of Driver Query language.\n<div style=\"width: 770px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/03\/examples-call-rest-api-json-sql-server-zappysys-odbc-driver.png\" alt=\"ZappySys JSON \/ REST Driver - Query Examples for PowerShell\" width=\"760\" height=\"797\" \/><p class=\"wp-caption-text\">ZappySys JSON \/ REST Driver &#8211; Query Examples for PowerShell<\/p><\/div><\/li>\n<li>ZappySys is pretty cool because you can run any type of query like SQL. For example, you can run a query to RESP API using <strong>like<\/strong> and <strong>or<\/strong>:\n<pre class=\"lang:tsql decode:true\">\/* \r\nObject name can be wrapped in double quotes or rectangle brackets\r\nuseful if name has space, dash or dot \r\n*\/\r\nSELECT \r\n CustomerID,\r\n CompanyName,\r\n ContactName,\r\n ContactTitle,\r\n Address,\r\n City,\r\n Region,\r\n PostalCode,\r\n Country,\r\n Phone,\r\n Fax\r\nFROM [value]\r\nWHERE ContactTitle='Owner'<\/pre>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>That&#8217;s it once you save your DSN you can change your previous script as below to use DSN<\/p>\n<pre class=\"lang:ps decode:true\">$conn = New-Object System.Data.Odbc.OdbcConnection\r\n\r\n$conn.connectionstring = \"DSN=ZappySys JSON PowerBI\"\r\n$conn.Open()\r\n$sql = \"SELECT * FROM value\"\r\n$cmd = $conn.CreateCommand()\r\n$cmd.CommandText = $sql\r\n$dataset = New-Object System.Data.DataSet\r\n\r\n#Load data in DataSet\r\n(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet)\r\n\r\n#Export datatable to file in CSV format\r\n$dataset.Tables[0] | ConvertTo-csv -NoTypeInformation -Delimiter \"`t\" | Out-File \"c:\\temp\\dump.csv\" -fo\r\n\r\nWrite-Host \"Total rows $($dataSet.Tables[0].Rows.Count)\"\r\n$conn.Close()<\/pre>\n<p>&nbsp;<\/p>\n<h3>Example 3 &#8211; Reading data from JSON\u00a0 files (Single \/ Multiple Files) in PowerShell<\/h3>\n<p>If you like to read JSON data from local file then use File Path rather than URL as below. Notice that we are reading data from multiple files using Wildcard pattern (*.json). For reading from multiple file make sure all files have same structure.<\/p>\n<pre class=\"lang:ps decode:true \">$conn = New-Object System.Data.Odbc.OdbcConnection\r\n\r\n$conn.connectionstring = \"DRIVER={ZappySys JSON Driver}\"\r\n$conn.Open()\r\n$sql = \"SELECT * FROM value WITH (SRC='C:\\temp\\File*.json')\"\r\n$cmd = $conn.CreateCommand()\r\n$cmd.CommandText = $sql\r\n$dataset = New-Object System.Data.DataSet\r\n\r\n#Load data in DataSet\r\n(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet)\r\n\r\n#Export datatable to file in CSV format\r\n$dataset.Tables[0] | ConvertTo-csv -NoTypeInformation -Delimiter \"`t\" | Out-File \"c:\\temp\\dump_multi_files.csv\" -fo\r\n\r\nWrite-Host \"Total rows $($dataSet.Tables[0].Rows.Count)\"\r\n$conn.Close()<\/pre>\n<p>&nbsp;<\/p>\n<h3>Example 4 &#8211; POST data to REST API URL (Supply Header \/ Body) in PowerShell<\/h3>\n<p>Now let&#8217;s look at some example to POST data to API.\u00a0 In below example we will also see how to pass HTTP headers and Body for POST request. POST requests usually made to Create or Update existing record. However sometimes you will call POST request to read data too (specially you have to supply many parameters in Body rather than URL to call your request).<\/p>\n<pre class=\"lang:ps decode:true \">$conn = New-Object System.Data.Odbc.OdbcConnection\r\n\r\n$conn.connectionstring = \"DRIVER={ZappySys JSON Driver}\"\r\n$conn.Open()\r\n$sql = @\"\r\nSELECT * FROM `$\r\nWITH \r\n( \r\n  SRC='http:\/\/httpbin.org\/post' ,\r\n  METHOD='POST' ,\r\n  HEADER='Content-Type: application\/json || x-hdr1: SomeValue' ,  \r\n  BODY='{ id:1, notes:\"My Line1\\r\\nMy Line2\" }'\r\n)\r\n\"@\r\n$cmd = $conn.CreateCommand()\r\n$cmd.CommandText = $sql\r\n$dataset = New-Object System.Data.DataSet\r\n\r\n#Load data in DataSet\r\n(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet)\r\n\r\n#Export datatable to file in CSV format\r\n$dataset.Tables[0] | ConvertTo-csv -NoTypeInformation -Delimiter \"`t\" | Out-File \"c:\\temp\\dump_post_response.csv\" -fo\r\n\r\nWrite-Host \"Total rows $($dataSet.Tables[0].Rows.Count)\"\r\n$conn.Close()<\/pre>\n<p>&nbsp;<\/p>\n<h3>Example 5 &#8211; Upload File Content to Web API in PowerShell<\/h3>\n<p>Now let&#8217;s look at example where you have to Upload File Content to Web API using PowerShell Script.<\/p>\n<pre class=\"lang:ps decode:true \">$conn = New-Object System.Data.Odbc.OdbcConnection\r\n\r\n$conn.connectionstring = \"DRIVER={ZappySys JSON Driver}\"\r\n$conn.Open()\r\n$sql = @\"\r\nSELECT * FROM `$\r\nWITH \r\n( \r\n  SRC='http:\/\/httpbin.org\/post' ,\r\n  METHOD='POST' ,\r\n  HEADER='Content-Type: application\/json || x-hdr1: SomeValue' ,  \r\n  BODY='@c:\\temp\\test.json',\r\n  IsMultiPart='True'\r\n)\r\n\"@\r\n$cmd = $conn.CreateCommand()\r\n$cmd.CommandText = $sql\r\n$dataset = New-Object System.Data.DataSet\r\n\r\n#Load data in DataSet\r\n(New-Object System.Data.Odbc.OdbcDataAdapter($cmd)).Fill($dataSet)\r\n\r\n#Export datatable to file in CSV format\r\n$dataset.Tables[0] | ConvertTo-csv -NoTypeInformation -Delimiter \"`t\" | Out-File \"c:\\temp\\file-upload-response.csv\" -fo\r\n\r\nWrite-Host \"Total rows $($dataSet.Tables[0].Rows.Count)\"\r\n$conn.Close()<\/pre>\n<h2>REST API with Pagination in PowerShell<\/h2>\n<div class=\"content_block\" id=\"custom_post_widget-3892\"><div style=\"margin-bottom: 1em;\">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that\u00a0<em>ZappySys ODBC Driver<\/em> includes many options to cover virtually any pagination method.<\/div>\r\n<div><span style=\"font-size: 16px;\">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):<\/span><\/div>\r\n<div style=\"margin-bottom: 1em;\"><a href=\"https:\/\/zappysys.com\/blog\/ssis-rest-api-looping-until-no-more-pages-found\/\" target=\"_blank\" rel=\"noopener\">https:\/\/zappysys.com\/blog\/ssis-rest-api-looping-until-no-more-pages-found\/<\/a><\/div>\r\n<h3>Paginate by Response Attribute<\/h3>\r\nThis example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.\r\n<pre class=\"lang:tsql decode:true codeblock\">SELECT * FROM $\r\nWITH(\r\nSRC=@'https:\/\/zappysys.com\/downloads\/files\/test\/pagination_nextlink_inarray_1.json'\r\n,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']\r\n)<\/pre>\r\n<h3>Paginate by URL Parameter (Loop until certain StatusCode)<\/h3>\r\nThis example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).\r\n<pre class=\"lang:tsql decode:true codeblock\">SELECT * FROM $\r\nWITH (\r\nSRC=@'https:\/\/zappysys.com\/downloads\/files\/test\/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'\r\n,PagingMode='ByUrlParameter'\r\n,PagingByUrlAttributeName='page'\r\n,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'\r\n,PagingByUrlCheckResponseStatusCode=401\r\n,IncrementBy=1\r\n)<\/pre>\r\n<h3>Paginate by URL Path (Loop until no record)<\/h3>\r\nThis example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).\r\n<pre class=\"lang:tsql decode:true codeblock\">SELECT * FROM $\r\nWITH (\r\nSRC=@'https:\/\/zappysys.com\/downloads\/files\/test\/cust-&lt;%page%&gt;.xml'\r\n,PagingMode='ByUrlPath'\r\n,PagingByUrlAttributeName='&lt;%page%&gt;'\r\n,PagingByUrlEndStrategy='DetectBasedOnRecordCount'\r\n,IncrementBy=1\r\n)<\/pre>\r\n<h3>Paginate by Header Link (RFC 5988)<\/h3>\r\nAPI like GitHub \/ Wordpress use Next link in Headers (<a href=\"https:\/\/tools.ietf.org\/html\/rfc5988\" target=\"_blank\" rel=\"noopener\">RFC 5988<\/a>)\r\n<pre class=\"lang:default decode:true \">SELECT * FROM $\r\nLIMIT 25\r\nWITH(\r\n\t Src='https:\/\/wordpress.org\/news\/wp-json\/wp\/v2\/categories?per_page=10'\r\n\t,PagingMode='ByResponseHeaderRfc5988'\r\n\t,WaitTimeMs='200' --\/\/wait 200 ms after each request\r\n)<\/pre>\r\n&nbsp;<\/div>\n<h2>REST API\u00a0Error Handling in PowerShell<\/h2>\n<div class=\"content_block\" id=\"custom_post_widget-3894\">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.\r\n<h3>METHOD 1 - Using Error Handling Options<\/h3>\r\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3949\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-api-error-handling-1.png\" alt=\"\" width=\"668\" height=\"702\" \/>\r\n<h4>When to use?<\/h4>\r\nYou may want to use them when your source is a resource located\u00a0on\u00a0the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.\r\n<h4>Scenario 1<\/h4>\r\nImagine a scenario, that there is a\u00a0web server which\u00a0each day at 12 AM releases a new JSON file with\u00a0that day's date as filename, e.g. <span style=\"text-decoration: underline;\"><em>http:\/\/www.some-server.com\/data\/2018-06-20.json<\/em><\/span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are\u00a0refreshed each\u00a0hour and you may get\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/HTTP_404\" target=\"_blank\" rel=\"noopener\">HTTP 404 status code<\/a>\u00a0(no file was found) when a\u00a0file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where\u00a0you could use\u00a0<strong><span class=\"lang:default highlight:0 decode:true crayon-inline\">Continue on any error<\/span><\/strong>\u00a0or <strong><span class=\"lang:default highlight:0 decode:true crayon-inline\">Continue when Url is invalid or missing (404 Errors)<\/span><\/strong>\u00a0to avoid an error being raised and let other data sources to be updated.\r\n<h4>Scenario 2<\/h4>\r\nAnother scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use\u00a0<strong><span class=\"lang:default highlight:0 decode:true crayon-inline\">Continue on any error<\/span><\/strong>\u00a0or alike together with\u00a0\u00a0<strong><span class=\"lang:default highlight:0 decode:true crayon-inline\">Get response data on error<\/span><\/strong>\u00a0to continue on an error and get the data:\r\n\r\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3961 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-get-response-data-on-error.png\" alt=\"\" width=\"547\" height=\"235\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-get-response-data-on-error.png 547w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-get-response-data-on-error-300x129.png 300w\" sizes=\"(max-width: 547px) 100vw, 547px\" \/>\r\n<h3>METHOD 2 - Using Connection [Retry Settings]<\/h3>\r\nAnother scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection<\/em>:\r\n\r\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3963 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-api-error-handling-3.png\" alt=\"\" width=\"671\" height=\"572\" \/><\/div>\n<h2>REST API Authentication\u00a0in PowerShell (Basic Auth, OAuth, JWT, SOAP WSS)<\/h2>\n<div class=\"content_block\" id=\"custom_post_widget-3896\"><div style=\"margin-bottom: 1em;\">If you need to authenticate or authorize your user to access a web resource, you will need to use one of\u00a0the <em>Connections:<\/em><\/div>\r\n<ul>\r\n \t<li>HTTP<\/li>\r\n \t<li>OAuth<\/li>\r\n<\/ul>\r\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4078 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-authentication-authorization-e1529337108252.png\" alt=\"ZappySys XML Driver - HTTP and OAuth Connection Types\" width=\"577\" height=\"302\" srcset=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w\" sizes=\"(max-width: 577px) 100vw, 577px\" \/>\r\n<h3>HTTP Connection<\/h3>\r\n<div style=\"margin-bottom: 1em;\">Use <em>HTTP Connection<\/em> for simple\u00a0Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!<\/div>\r\n<div style=\"margin-bottom: 1em;\">You can also use <em>HTTP Connection<\/em> for more sophisticated authentication like:<\/div>\r\n<ul>\r\n \t<li><strong>SOAP WSS<\/strong> (when accessing a SOAP WebService)<\/li>\r\n \t<li><strong>Static Token \/ API Key<\/strong> (when need to pass an API key in HTTP header)<\/li>\r\n \t<li><strong>Dynamic Token<\/strong> (same as Static Token method except that each time you need to log in\u00a0and retrieve a fresh API key)<\/li>\r\n \t<li><strong>JWT Token<\/strong> (As per RFC 7519)<\/li>\r\n<\/ul>\r\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-4091 size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-api-connection-type-1.png\" alt=\"\" width=\"622\" height=\"570\" \/>\r\n<h3>OAuth<\/h3>\r\nIf you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection<\/em>. <a href=\"https:\/\/zappysys.com\/blog\/rest-api-authentication-with-oauth-2-0-using-ssis\/\" target=\"_blank\" rel=\"noopener\">Read this article<\/a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\" target=\"_blank\" rel=\"noopener\">SSIS PowerPack<\/a>, but the concepts and UI stay the same):\u00a0<br\/>\r\n<a href=\"https:\/\/zappysys.com\/blog\/rest-api-authentication-with-oauth-2-0-using-ssis\/\" target=\"_blank\" rel=\"noopener\">https:\/\/zappysys.com\/blog\/rest-api-authentication-with-oauth-2-0-using-ssis\/<\/a>\r\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/06\/odbc-api-connection-type-2.png\" width=\"721\" height=\"708\" \/><\/div>\n<h2>Other Consideration for REST API call in PowerShell<\/h2>\n<div class=\"content_block\" id=\"custom_post_widget-3901\">There are few settings you can coder while calling Web API\r\n<h3><strong>API Limit \/ Throttling<\/strong><\/h3>\r\nWhile calling public API or other external web services one important aspect you have to check,\u00a0 how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.\r\n<h3><strong>2D Array Transformation<\/strong><\/h3>\r\nIf you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href=\"https:\/\/zappysys.com\/blog\/parse-multi-dimensional-json-array-ssis\/\" target=\"_blank\" rel=\"noopener\">Check this link<\/a> for more information.\r\n\r\n&nbsp;<\/div>\n<h2>Conclusion<\/h2>\n<p>In this article we checked how to read REST API and JSON Files in PowerShell with minimum coding effort. Download <a href=\"https:\/\/zappysys.com\/products\/odbc-powerpack\/\">ZappySys ODBC PowerPack<\/a> to enhance your overall API integration scenarios in PowerShell and other programming languages such as Python, C# or tools like Power BI, Excel, SSRS, Informatica.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this article we will cover how to call REST API in PowerShell and export result to CSV file. If you want to export JSON based API result to file then you have to consider few things. Such as API Authentication, API Pagination, Parsing JSON, Error Handling and many more. Luckily we can use [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4839,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[277,276,345],"tags":[6,279,309,3],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog<\/title>\r\n<meta name=\"description\" content=\"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog\" \/>\r\n<meta property=\"og:description\" content=\"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/\" \/>\r\n<meta property=\"og:site_name\" content=\"ZappySys Blog\" \/>\r\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ZappySys\/\" \/>\r\n<meta property=\"article:published_time\" content=\"2018-09-14T19:08:36+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2018-09-28T17:34:39+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"256\" \/>\r\n\t<meta property=\"og:image:height\" content=\"256\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"ZappySys\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/zappysys\/\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ZappySys\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/\",\"url\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/\",\"name\":\"Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\",\"datePublished\":\"2018-09-14T19:08:36+00:00\",\"dateModified\":\"2018-09-28T17:34:39+00:00\",\"author\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82\"},\"description\":\"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV\",\"breadcrumb\":{\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage\",\"url\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\",\"contentUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png\",\"width\":256,\"height\":256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zappysys.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Call REST API in PowerShell Script &#8211; Export JSON to CSV\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zappysys.com\/blog\/#website\",\"url\":\"https:\/\/zappysys.com\/blog\/\",\"name\":\"ZappySys Blog\",\"description\":\"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zappysys.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82\",\"name\":\"ZappySys\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g\",\"caption\":\"ZappySys\"},\"sameAs\":[\"http:\/\/www.zappysys.com\/\",\"https:\/\/www.facebook.com\/ZappySys\/\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/zappysys\/\"],\"url\":\"https:\/\/zappysys.com\/blog\/author\/admin\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog","description":"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/","og_locale":"en_US","og_type":"article","og_title":"Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog","og_description":"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV","og_url":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/","og_site_name":"ZappySys Blog","article_author":"https:\/\/www.facebook.com\/ZappySys\/","article_published_time":"2018-09-14T19:08:36+00:00","article_modified_time":"2018-09-28T17:34:39+00:00","og_image":[{"width":256,"height":256,"url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png","type":"image\/png"}],"author":"ZappySys","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/zappysys\/","twitter_misc":{"Written by":"ZappySys","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/","url":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/","name":"Call REST API in PowerShell Script - Export JSON to CSV | ZappySys Blog","isPartOf":{"@id":"https:\/\/zappysys.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage"},"image":{"@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage"},"thumbnailUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png","datePublished":"2018-09-14T19:08:36+00:00","dateModified":"2018-09-28T17:34:39+00:00","author":{"@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82"},"description":"Learn how to call REST API in PowerShell Script in few lines. Authenticate RESTful web service (OAuth, JWT, Basic), Paginate response, export JSON to CSV","breadcrumb":{"@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#primaryimage","url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png","contentUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/09\/powershell-api-inategration-logo.png","width":256,"height":256},{"@type":"BreadcrumbList","@id":"https:\/\/zappysys.com\/blog\/call-rest-api-powershell-script-export-json-csv\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zappysys.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Call REST API in PowerShell Script &#8211; Export JSON to CSV"}]},{"@type":"WebSite","@id":"https:\/\/zappysys.com\/blog\/#website","url":"https:\/\/zappysys.com\/blog\/","name":"ZappySys Blog","description":"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zappysys.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/2756c237457fbc95d82cb38962f81f82","name":"ZappySys","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c9be148088ba9b8af8e955c5f7c22b5?s=96&d=mm&r=g","caption":"ZappySys"},"sameAs":["http:\/\/www.zappysys.com\/","https:\/\/www.facebook.com\/ZappySys\/","https:\/\/twitter.com\/https:\/\/twitter.com\/zappysys\/"],"url":"https:\/\/zappysys.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4828"}],"collection":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/comments?post=4828"}],"version-history":[{"count":10,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4828\/revisions"}],"predecessor-version":[{"id":4831,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/4828\/revisions\/4831"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media\/4839"}],"wp:attachment":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media?parent=4828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/categories?post=4828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/tags?post=4828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}