[{"id":3087,"date":"2017-03-22T17:34:12","date_gmt":"2017-03-22T22:34:12","guid":{"rendered":"https:\/\/digitalborn.org\/?p=3087"},"modified":"2024-01-15T10:34:23","modified_gmt":"2024-01-15T15:34:23","slug":"data-analysts-get-data-from-the-airtable-api","status":"publish","type":"post","link":"https:\/\/digitalborn.org\/data-analysts-get-data-from-the-airtable-api\/","title":{"rendered":"Get Data from the Airtable API the Easy Way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Airtable is part spreadsheet and part relational database management system. It makes a good, simple tool for analysts to organize basic data. While Airtable provides the option to export to CSV, let&#8217;s look at how to get the data in real time through the API.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Sign in&nbsp;to Airtable<br \/><a href=\"https:\/\/airtable.com\/login\">https:\/\/airtable.com\/login<\/a><\/li>\n<\/ol>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If you haven&#8217;t already, go to <a href=\"https:\/\/airtable.com\/account\" target=\"_blank\" rel=\"noopener\">your account settings<\/a> and click &#8220;Generate API key&#8221;<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3088 size-large\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-1024x226.png\" alt=\"generate API key image\" width=\"960\" height=\"212\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-1024x226.png 1024w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-300x66.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-768x170.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-645x142.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM-662x146.png 662w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/Screen-Shot-2017-03-22-at-5.23.25-PM.png 1522w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the API hub for your bases<br \/><a href=\"https:\/\/airtable.com\/api\">https:\/\/airtable.com\/api<\/a>&nbsp;and select the base where you want to retrieve data.<br \/>Note: use a base that already has some entries or add a few test entries<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Scroll down to the Authentication section and note the base id<br \/><span class=\"hljs-variable ng-scope\">$ <\/span><span class=\"ng-binding ng-scope\">curl https:\/\/api.airtable.com\/v0\/[highlight]app0LWmcz9Bjd56KV[\/highlight]\/<\/span><span class=\"hljs-constant ng-scope\">Donations<\/span><span class=\"ng-scope\"> \\ &#8211;<\/span><span class=\"hljs-constant ng-scope\">H<\/span> <span class=\"hljs-string ng-binding ng-scope\"><span class=\"hljs-string ng-binding ng-scope\">&#8220;Authorization: Bearer YOUR_API_KEY&#8221;<\/span><\/span><\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Now we will use your API key and this base id to form our request<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Examples<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In the below examples we will get five records from a view called &#8220;Main View&#8221; and a base called &#8220;Donations&#8221;.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Python<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>import requests<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">headers = {<br \/>&#8216;Authorization&#8217;: &#8216;Bearer yourapikey&#8217;,<br \/>}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">params = (<br \/>(&#8216;maxRecords&#8217;, &#8216;5&#8217;),<br \/>(&#8216;view&#8217;, &#8216;Main View&#8217;),<br \/>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">r = requests.get(&#8216;https:\/\/api.airtable.com\/v0\/app0LWmcz9Bjd56KV\/Donations&#8217;, headers=headers, params=params)<br \/>from pprint import pprint<br \/>pprint(r.json())<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Excel<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open Excel (comes default in Excel 2016 but otherwise you&#8217;ll need to download the Power Query Addon)<\/li>\n\n\n\n<li>Click on Data -&gt; New Query -&gt; From Other Sources -&gt; From Web<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/excel_api_connect.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3091\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/excel_api_connect.png\" alt=\"\" width=\"570\" height=\"491\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/excel_api_connect.png 570w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/excel_api_connect-300x258.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/a><\/li>\n\n\n\n<li>Select Advanced<\/li>\n\n\n\n<li>Add the URL for the base to the URL field<\/li>\n\n\n\n<li>Select Authorization for the Header and use &#8220;Bearer yourapikey&#8221;<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_excel_from_web.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3092\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_excel_from_web.png\" alt=\"\" width=\"598\" height=\"398\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/airtable_excel_from_web.png 598w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/airtable_excel_from_web-300x200.png 300w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><\/a><\/li>\n\n\n\n<li>Select OK<\/li>\n\n\n\n<li>Convert Into Table<br \/><a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_into_table.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3093\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_into_table.png\" alt=\"\" width=\"151\" height=\"172\"\/><\/a><\/li>\n\n\n\n<li>Click on arrows in column header to Expand to New Rows<br \/>Note: repeat this step on any additional columns with arrows in the header<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_excel_expand.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3094\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable_excel_expand.png\" alt=\"\" width=\"528\" height=\"135\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/airtable_excel_expand.png 528w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2017\/03\/airtable_excel_expand-300x77.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/a><\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it. Here&#8217;s a quick screencast of me doing this in a minute<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable-api-excel.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"1861\" height=\"899\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2017\/03\/airtable-api-excel.gif\" alt=\"\" class=\"wp-image-3090\"\/><\/a><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Power BI<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The steps in Power BI are almost identical to Excel.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open Power BI Desktop<\/li>\n\n\n\n<li>Select Get Data -&gt; Web<\/li>\n\n\n\n<li>Follow the connect and expand steps in the Excel instructions above<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">R<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"># See https:\/\/github.com\/bergant\/airtabler for how to use this R package<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">library(pacman)<br \/>p_load(devtools)<br \/>devtools::install_github(&#8220;bergant\/airtabler&#8221;) # if not yet installed<br \/>p_load(airtabler)<br \/># This won&#8217;t work unless you have a one-line file .Renviron in your home directory. To check where your home is, type path.expand(&#8220;~&#8221;)<br \/># You will get your API key and base id from your Airtable account<br \/>base_id &lt;- &#8220;pp0LWmcz9Bjd56KV&#8221;<br \/>dat<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">curl<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>$ curl \"https:\/\/api.airtable.com\/v0\/app0LWmcz9Bjd56KV\/Donations?maxRecords=5&amp;view=Main%20View\" \\<br \/>\n-H \"Authorization: Bearer YOUR_API_KEY\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article shows you how to engage with the AirTable API to pull data into your preferred analysis tool such as Excel Get and Transform or Power BI.<\/p>\n","protected":false},"author":5,"featured_media":3095,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[162,143,114],"tags":[173,150],"class_list":["post-3087","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-data","category-tech-tips","tag-airtable","tag-api"],"_links":{"self":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/comments?post=3087"}],"version-history":[{"count":0,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3087\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media\/3095"}],"wp:attachment":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media?parent=3087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/categories?post=3087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/tags?post=3087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":3076,"date":"2016-11-18T17:13:50","date_gmt":"2016-11-18T22:13:50","guid":{"rendered":"https:\/\/digitalborn.org\/?p=3076"},"modified":"2024-01-15T10:36:46","modified_gmt":"2024-01-15T15:36:46","slug":"get-survey-monkey-data-using-the-rest-api","status":"publish","type":"post","link":"https:\/\/digitalborn.org\/get-survey-monkey-data-using-the-rest-api\/","title":{"rendered":"Get Survey Monkey Data Using the REST API"},"content":{"rendered":"<p><strong>Update 12\/22\/17<\/strong> Survey Monkey requires you to alter the OAuth redirect url and update the scopes before you can deploy your app. I&#8217;ve updated the post to reflect these changes.<br \/>\n<strong>Update 3\/31\/17:<\/strong> Survey Monkey now provides an access token for 90 days when you create an app. So unless you need to use the API for more than 90 days and you have a Platinum plan, then you can just read these long story short instructions.<\/p>\n<h2>Long Story Short<\/h2>\n<p>When we talk about an &#8220;app&#8221; in our case, we&#8217;re just sort of faking it so that we can get an access token. <\/p>\n<p>Instead of generating a &#8220;long lived&#8221; token (i.e., lasts more than 90 days), I would recommend just following these simple steps:<\/p>\n<p><a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/survey-monkey-api.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/survey-monkey-api.gif\" alt=\"Click on add a new app and then make sure to change OAuth redirect url and add scopes\" width=\"1228\" height=\"627\" class=\"alignnone size-full wp-image-3139\" \/><\/a><\/p>\n<p>1. Go to My Apps and click <strong>Add a New App<\/strong><br \/>\n<a href=\"https:\/\/developer.surveymonkey.com\/apps\/\">https:\/\/developer.surveymonkey.com\/apps\/<\/a><\/p>\n<p>2. Give your app a <strong>nickname<\/strong><\/p>\n<p>3. Set it to <strong>Public App<\/strong><\/p>\n<p>4. Click <strong>Create App<\/strong><\/p>\n<p>5. Click on <strong>Settings<\/strong><\/p>\n<p>6. Change the <strong>OAuth Redirect URL<\/strong> to anything (e.g., your personal site, https:\/\/google.com, etc.)<\/p>\n<p>7. Click <strong>Submit Changes<\/strong><\/p>\n<p>8. Modify the scopes (e.g., set them to &#8220;Optional&#8221;><\/p>\n<p>9. Click <strong>Update Scopes<\/strong><\/p>\n<p>10. Click <strong>Deploy<\/strong><\/p>\n<p>11. Copy your access token and use it for authorization in your request<\/p>\n<p>That&#8217;s it. You don&#8217;t need to do anything else in terms of the app set up and configuration for our purposes. <\/p>\n<p><strong>Now that you have your access token you can request your survey data.<\/strong><br \/>\nIf you like Python you could use this:<\/p>\n<p><code>import requests<br \/>\nimport json<\/p>\n<p>client = requests.session()<\/p>\n<p>headers = {<br \/>\n    \"Authorization\": \"bearer %s\" % \"YOUR_ACCESS_TOKEN\",<br \/>\n    \"Content-Type\": \"application\/json\"<br \/>\n}<\/p>\n<p>data = {}<\/p>\n<p>HOST = \"https:\/\/api.surveymonkey.net\"<br \/>\nSURVEY_LIST_ENDPOINT = \"\/v3\/surveys\"<\/p>\n<p>uri = \"%s%s\" % (HOST, SURVEY_LIST_ENDPOINT)<\/p>\n<p>response = client.get(uri, headers=headers)<\/p>\n<p>response_json = response.json()<br \/>\n#survey_list = response_json[\"data\"][\"surveys\"]<\/p>\n<p>print(response_json)<\/code><\/p>\n<p>and replace &#8220;YOUR_ACCESS_TOKEN&#8221; with the access token in your app. <\/p>\n<p><strong>For cURL<\/strong><\/p>\n<p><code>curl -i -X GET -H \"Authorization:bearer YOUR_ACCESS_TOKEN\" -H \"Content-Type\": \"application\/json\" https:\/\/api.surveymonkey.net\/v3\/surveys<\/code><\/p>\n<p>Similarly, if you were using this in <strong>Power BI or Excel&#8217;s Get &#038; Transform<\/strong>, you could<\/p>\n<p>1. Get Data -> Web<br \/>\n2. Paste https:\/\/api.surveymonkey.net\/v3\/surveys into the web source field<br \/>\n3. Click Advanced<br \/>\n4. Select Authorization in the dropdown and then in the field enter Bearer YOUR_ACCESS_TOKEN<\/p>\n<hr \/>\n<p>Recently Survey Monkey updated their REST API to version 3, which increases the difficulty of requesting data for use in your analysis tools (e.g., R, Power BI, etc.). The language and instructions used in this post should be easy enough for a non-developer (with patience) to understand.\u00a0The goal is to allow Survey Monkey account administrators to create Survey Monkey apps that then allow authenticating and getting data from their Survey Monkey account.<\/p>\n<p>Why would you want to do this? Well there could be several reasons but, for most people, the main benefit is to get real-time, updated data while eliminating the\u00a0need to login to Survey Monkey to perform several manual steps to get your data.<\/p>\n<p>There are two parts of this process: 1. Authentication, and 2. Getting the data<\/p>\n<p>You only need to authenticate occasionally since you can use a long lived token. For most people, the authentication part is the most difficult. Once we generate a token, getting data is pretty straightforward.<\/p>\n<h2 id=\"GetSurveyMonkeyDataUsingtheRESTAPI-High-LevelWorkflow\">High-Level Workflow<\/h2>\n<ol>\n<li>Survey Monkey account administrator creates a Survey Monkey app (or uses an existing app)<\/li>\n<li>Using the information provided with that app, get an access token to use for authentication with a data analysis tool<\/li>\n<li>Once access token has been acquired, use data analysis tool to authenticate into Survey Monkey REST API<\/li>\n<li>Retrieve Survey list to get survey ID<\/li>\n<li>Retrieve survey responses<\/li>\n<\/ol>\n<h2>Authenticate<\/h2>\n<p>Note: for the purposes of this guide, we will use Postman. You could choose a number of other routes but I think this is one of the more simple approaches for data analysts.<\/p>\n<ol>\n<li>Log in to <strong>Survey Monkey<\/strong><br \/>\n<a class=\"external-link\" href=\"https:\/\/www.surveymonkey.com\/\" rel=\"nofollow\">https:\/\/www.surveymonkey.com<\/a><\/li>\n<li>Go to <strong>My Apps<\/strong> in the Developer area<br \/>\nhttps:\/\/developer.surveymonkey.com\/apps\/<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev.png\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3077 alignnone\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev.png\" alt=\"my_apps_survey_monkey_dev\" width=\"461\" height=\"84\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev.png 796w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev-300x55.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev-768x140.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev-645x117.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps_survey_monkey_dev-662x121.png 662w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><\/li>\n<li>Either <strong>create a new app<\/strong> or <strong>use an existing app<br \/>\n<\/strong><a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/my_apps.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3078\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/my_apps.png\" alt=\"my_apps\" width=\"454\" height=\"150\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps.png 999w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps-300x99.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps-768x254.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps-645x213.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/my_apps-662x219.png 662w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/a><\/li>\n<li>Click on <strong>Settings<\/strong> for your app and use this OAuth Redirect URL<br \/>\nhttps:\/\/www.getpostman.com\/oauth2\/callback<br \/>\n<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/oauth_redirect.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3079\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/oauth_redirect.png\" alt=\"oauth_redirect\" width=\"449\" height=\"137\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/oauth_redirect.png 747w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/oauth_redirect-300x92.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/oauth_redirect-645x197.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/oauth_redirect-662x202.png 662w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><\/li>\n<li><strong>Install Postman<\/strong> on your computer<br \/>\nhttps:\/\/www.getpostman.com\/<br \/>\nOkay, this is where it gets complicated. I won&#8217;t go into details about why you have to use Postman. You could actually create a real app to interface with Survey Monkey but, since we just need to get data, this would be a lot of unnecessary work. So we fake it in order to get our access token using Postman.<\/li>\n<li><strong>Open Postman <\/strong>and enter basic info<br \/>\n<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3080\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect.png\" alt=\"survey_monkey_postman_connect\" width=\"712\" height=\"183\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect.png 899w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect-300x77.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect-768x197.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect-645x166.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/survey_monkey_Postman_connect-662x170.png 662w\" sizes=\"auto, (max-width: 712px) 100vw, 712px\" \/><br \/>\n<\/a>a. Add this <strong>URL<\/strong> to GET<br \/>\nhttps:\/\/api.surveymonkey.net\/oauth\/authorize<\/p>\n<p>b. Select <strong>OAuth 2.0<\/strong><\/p>\n<p>c. click <strong>Get New Access Token<\/strong><\/li>\n<li>Now use the information from your Survey Monkey app in My Apps to complete the info and click Request Token<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/access_token_postman_sm.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3081\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/access_token_postman_sm.png\" alt=\"access_token_postman_sm\" width=\"512\" height=\"608\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_postman_sm.png 512w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_postman_sm-253x300.png 253w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/li>\n<li>It will prompt you to login using your Survey Monkey admin credentials and ask you to complete a captcha in order to <strong><\/strong><strong>Authorize<\/strong><\/li>\n<li>At long last, we will get our token. Use access_token to authenticate in your data analysis tool<a href=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/access_token_long_lived.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3082\" src=\"https:\/\/digitalborn.org\/wp-content\/uploads\/2016\/11\/access_token_long_lived.png\" alt=\"access_token_long_lived\" width=\"831\" height=\"170\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_long_lived.png 831w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_long_lived-300x61.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_long_lived-768x157.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_long_lived-645x132.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/11\/access_token_long_lived-662x135.png 662w\" sizes=\"auto, (max-width: 831px) 100vw, 831px\" \/><\/a><br \/>\nNote: you can create tokens that expire at a given date but that&#8217;s for another dayWhew! So with that out of the way, we can reuse this forever. You only have to do this once. Onward!<\/li>\n<\/ol>\n<h4>Examples<\/h4>\n<h4>Power BI Authentication Example<\/h4>\n<ol>\n<li>In Power BI Desktop, click on Get Data -&gt; Blank Query<\/li>\n<li>Click on Advanced Editor and use this to get a list of surveys from your Survey Monkey account. The two parts of this that are important are the Survey Monkey API URL and you will replace &#8220;&lt;&lt;API-TOKEN&gt;&gt;&#8221; with the access token you generated using Postman.\n<pre>let\r\n\u00a0\u00a0\u00a0 Source = Web.Contents(\"https:\/\/api.surveymonkey.net\/v3\/surveys\", [Headers=[#\"Authorization\"=\"bearer &lt;&lt;API-TOKEN&gt;&gt;\"]]),\r\n\u00a0\u00a0\u00a0 convertToJson = Json.Document(Source),\r\n\u00a0\u00a0\u00a0 toTable = Table.FromRecords({convertToJson})\r\nin\r\n\u00a0\u00a0\u00a0 toTable<\/pre>\n<\/li>\n<\/ol>\n<h4>R Authentication Example<\/h4>\n<p>You will enter your access token you painstakingly generated in Postman in the space where it says &#8220;Enter your access token for SurveyMonkey&#8221; below:<\/p>\n<pre>sm_get_surveys &lt;- function(auth_token, page = 1, per_page = 250) {\r\n if (missing(auth_token)) {\r\n auth_token &lt;- readline('Enter your access token for SurveyMonkey: ')\r\n }\r\n auth &lt;- paste(\"bearer\", auth_token, sep=\" \");\r\n url &lt;- paste('https:\/\/api.surveymonkey.net\/v3\/surveys?page=', page, '&amp;per_page=', per_page, sep='')\r\n survey_list_response &lt;- httr::GET(url=url, add_headers(\"Content-Type\" = \"application\/json\", \"Authorization\" = auth ))\r\n \r\n if (survey_list_response$status_code != 200) {\r\n stop(paste('Bad response from server: ', httr::http_status(survey_list_response)))\r\n }\r\n json &lt;- httr::content(survey_list_response, as = 'text')\r\n survey_list &lt;- jsonlite::fromJSON(json)\r\n survey_list\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<h2>Get the Data<\/h2>\n<p>So after you authenticate, you have to request the data. I&#8217;ll show you how to get all of the responses for a survey but there are a lot of options available:<br \/>\n<a href=\"https:\/\/developer.surveymonkey.com\/api\/v3\/\">https:\/\/developer.surveymonkey.com\/api\/v3\/<\/a><\/p>\n<ol>\n<li>Get survey list (list of survey ids)<br \/>\n<a href=\"https:\/\/api.surveymonkey.net\/v3\/surveys\">https:\/\/api.surveymonkey.net\/v3\/surveys<\/a><\/li>\n<li>Use a specific survey id from the list retrieved in #1 to get responses in bulk<br \/>\n<a href=\"https:\/\/api.surveymonkey.net\/v3\/surveys\/{survey_id}\/responses\/bulk\">https:\/\/api.surveymonkey.net\/v3\/surveys\/{survey_id}\/responses\/bulk<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article demonstrates how to engage with the Survey Monkey API to get form data.<\/p>\n","protected":false},"author":5,"featured_media":3084,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[162,143,114],"tags":[150,172,171,170],"class_list":["post-3076","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-data","category-tech-tips","tag-api","tag-oauth","tag-postman","tag-survey-monkey"],"_links":{"self":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/comments?post=3076"}],"version-history":[{"count":0,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3076\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media\/3084"}],"wp:attachment":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media?parent=3076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/categories?post=3076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/tags?post=3076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":3044,"date":"2016-07-05T16:00:18","date_gmt":"2016-07-05T20:00:18","guid":{"rendered":"http:\/\/digitalborn.org\/?p=3044"},"modified":"2016-07-05T18:25:12","modified_gmt":"2016-07-05T22:25:12","slug":"unlock-form-data-formidable-zapier-webhooks","status":"publish","type":"post","link":"https:\/\/digitalborn.org\/unlock-form-data-formidable-zapier-webhooks\/","title":{"rendered":"Unlock Form Data: Formidable and Webhooks by Zapier"},"content":{"rendered":"<p>Want to send Formidable form data using Zapier? If you&#8217;re using WordPress and Formidable forms, then you will likely find this guide helpful. This quick how-to guide walks you through easily sending your form data to other apps and services.<\/p>\n<p>Examples:<\/p>\n<ul>\n<li>When someone submits a form, add the entry to Google Sheets<\/li>\n<li>When someone updates an entry, add a new line to a DropBox text file<\/li>\n<li>When someone creates an entry, add a row to a PostgreSQL database<\/li>\n<\/ul>\n<p>The options are really only limited to the available apps in Zapier.<\/p>\n<h3>What You Need<\/h3>\n<ul>\n<li>WordPress site<\/li>\n<li>Formidable Pro plugin<\/li>\n<li>Formidable API plugin<\/li>\n<li>Zapier account<\/li>\n<\/ul>\n<h3>How It Works<\/h3>\n<ol>\n<li>Go to Form you want to collect reporting data from<\/li>\n<li>Add a Form Action to form in Settings -&gt; Form Actions<\/li>\n<li>Select the action &#8220;Send API data&#8221;<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3047\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable.png\" alt=\"send_data_to_api_formidable\" width=\"500\" height=\"197\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable.png 718w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable-300x118.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable-645x254.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/send_data_to_api_formidable-662x261.png 662w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/li>\n<li>Click the &#8220;Insert Default&#8221; button for Data Format in your &#8220;Send API data&#8221; form action<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/insert_default_formidable.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3048\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/insert_default_formidable-1024x210.png\" alt=\"insert_default_formidable\" width=\"604\" height=\"124\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable-1024x210.png 1024w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable-300x62.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable-768x158.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable-645x132.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable-662x136.png 662w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/insert_default_formidable.png 1214w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/a><\/li>\n<li>For &#8220;Trigger this action&#8221;, select &#8220;Create&#8221; and &#8220;Update&#8221; in the form action<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/trigger_action_formidable.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3049\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/trigger_action_formidable.gif\" alt=\"trigger_action_formidable\" width=\"373\" height=\"113\" \/><\/a><\/li>\n<li>Log into Zapier, and click &#8220;Make a Zap&#8221;<\/li>\n<li>Select Webhooks by Zapier<\/li>\n<li>For Trigger, select &#8220;Catch Hook&#8221; and Continue<\/li>\n<li>Just skip the optional &#8220;Pick off a child key&#8221; by clicking Continue<\/li>\n<li>Copy the Webhook URL provided by Zapier<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/zapier_webhooks.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3051 size-full\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/zapier_webhooks.gif\" alt=\"zapier_webhooks\" width=\"1610\" height=\"760\" \/><\/a><\/li>\n<li>Paste this webhook URL into my &#8220;Send API data&#8221; form action in the Notification URL field<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3053\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1.png\" alt=\"notification_url_formidable (1)\" width=\"512\" height=\"150\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1.png 974w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1-300x88.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1-768x225.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1-645x189.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/07\/notification_url_formidable-1-662x194.png 662w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/li>\n<li>Click Continue in Zapier and then select your action app (e.g., Excel, Google Sheets, MySQL, etc.)<\/li>\n<li>Create a test entry in Formidable<\/li>\n<li>Do the necessary mapping<\/li>\n<li>Turn the Zap to On<\/li>\n<\/ol>\n<p>That&#8217;s it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to send Formidable form data using Zapier? If you&#8217;re using WordPress and Formidable forms, then you will likely find this guide helpful. This quick how-to guide walks you through easily sending your form data to other apps and services. Examples: When someone submits a form, add the entry to Google Sheets When someone updates [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3055,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[162,114],"tags":[150,159,168,145,167],"class_list":["post-3044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-tech-tips","tag-api","tag-formidable","tag-webhooks","tag-wordpress","tag-zapier"],"_links":{"self":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/comments?post=3044"}],"version-history":[{"count":0,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3044\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media\/3055"}],"wp:attachment":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media?parent=3044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/categories?post=3044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/tags?post=3044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":3030,"date":"2016-06-27T12:36:34","date_gmt":"2016-06-27T16:36:34","guid":{"rendered":"http:\/\/digitalborn.org\/?p=3030"},"modified":"2016-06-30T17:21:18","modified_gmt":"2016-06-30T21:21:18","slug":"send-wordpress-multisite-emails-mailgun","status":"publish","type":"post","link":"https:\/\/digitalborn.org\/send-wordpress-multisite-emails-mailgun\/","title":{"rendered":"How to Send WordPress Multisite Emails with Mailgun"},"content":{"rendered":"<p>What is Mailgun and why would you want to use it on your WordPress network? Like Mandrill, AWS Simple Email Service (SES), and Mailjet, Mailgun is a transactional email service that allows you to offload the complex and frustrating task of email routing and delivery. While you can send emails directly from your WordPress server, this can be 1. risky because you (or your host) could end up labeled as a spam originator, and 2. your mail is less likely to be delivered from a shared IP or server. \u00a0You know those envelopes you receive with a generic return label or addressed to &#8220;current resident&#8221;? That&#8217;s what your email looks like to other email services if you aren&#8217;t using a transactional email service like Mailgun.<\/p>\n<p>I recommend Mailgun to most clients because Mandrill, which is owned by MailChimp, decided to start charging everyone for a MailChimp account even if they were only using the transactional mail service. If you already pay for MailChimp, it may make sense for you to use Mandrill instead of Mailgun. If you don&#8217;t already pay for a MailChimp account, it is much cheaper (mostly likely free) to use Mailgun.<\/p>\n<p>In addition, in my experience Mailgun is the easiest to configure, especially for WordPress Multisite. Plus, you get 10,000 free emails per month. Unless you have a really large network, you will get tracking and logging features as well as improved rates of delivery without paying a dime.<\/p>\n<h2>Get Started<\/h2>\n<ol>\n<li>Create a <a href=\"https:\/\/www.mailgun.com\/\">Mailgun account<\/a><\/li>\n<li>Add your domain (e.g., example.com)<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/add_new_domain.png\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3031\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/add_new_domain.png\" alt=\"Add New Domain Mailgun\" width=\"279\" height=\"164\" \/><br \/>\n<\/a><\/li>\n<li>Mailgun will provide you with records to add to your domain: 2 TXT, 1 CNAME, and 2 MX records.<br \/>\nDepending on your domain registrar, this may differ slightly but you will login to GoDaddy or Bluehost or Namecheap, etc., click on Domain Manager. You will then follow the instructions in Mailgun<\/li>\n<li>Once these are added, click Check DNS Records Now<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/check_dns_records.png\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3032 size-medium\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/check_dns_records-300x84.png\" alt=\"check_dns_records\" width=\"300\" height=\"84\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/check_dns_records-300x84.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/check_dns_records.png 329w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/a>If all goes well, you will see a green Active notice, which indicates that you&#8217;ve correctly verified your domain.<\/li>\n<li>Add the Mailgun WordPress plugin to your site<br \/>\n[button link=&#8221;https:\/\/wordpress.org\/plugins\/mailgun\/&#8221; bg_color=&#8221;#ffffff&#8221; border=&#8221;#676767&#8243; text=&#8221;dark&#8221;\u00a0window=&#8221;yes&#8221;]Mailgun Plugin[\/button]<\/li>\n<li>Open your wp-config.php file and enter these six lines:<br \/>\n<code>define('MAILGUN_USEAPI', true);<br \/>\ndefine('MAILGUN_APIKEY', 'key-yourkeyhere');<br \/>\ndefine('MAILGUN_DOMAIN', 'mydomain.com' );<br \/>\ndefine('MAILGUN_USERNAME', 'postmaster');<br \/>\ndefine('MAILGUN_PASSWORD', 'yourMailgunSMTPpasswordhere');<br \/>\ndefine('MAILGUN_SECURE', false);<\/code>You can find this information by clicking on Domains and then click on your verified domain<\/li>\n<li>Go back to your WP network admin dashboard and Network Activate the Mailgun plugin.<\/li>\n<\/ol>\n<p>That&#8217;s it.<\/p>\n<p>Now your emails will be sent using Mailgun instead of your server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Mailgun and why would you want to use it on your WordPress network? Like Mandrill, AWS Simple Email Service (SES), and Mailjet, Mailgun is a transactional email service that allows you to offload the complex and frustrating task of email routing and delivery. While you can send emails directly from your WordPress server, [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3037,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[114],"tags":[165,166,145],"class_list":["post-3030","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-tips","tag-email","tag-mailgun","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/comments?post=3030"}],"version-history":[{"count":0,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3030\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media\/3037"}],"wp:attachment":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media?parent=3030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/categories?post=3030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/tags?post=3030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}},{"id":3017,"date":"2016-06-20T14:01:51","date_gmt":"2016-06-20T18:01:51","guid":{"rendered":"http:\/\/digitalborn.org\/?p=3017"},"modified":"2025-02-22T11:24:15","modified_gmt":"2025-02-22T16:24:15","slug":"display-wp-posts-rest-api","status":"publish","type":"post","link":"https:\/\/digitalborn.org\/display-wp-posts-rest-api\/","title":{"rendered":"Display WordPress Posts on Another Site with WP REST API"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Have a WordPress site and want to include\u00a0your posts on an external site? In this tutorial, I will show you how to use the WordPress REST API to display your posts on a static site with just HTML, CSS, and Javascript.<\/p>\n<p>There are several scenarios where this might be useful but here are the two directly applicable to this tutorial:<\/p>\n<ul>\n<li>You want to display a feed of posts on static web hosting\u00a0(e.g., GitHub Pages, AWS S3, etc.) for your professional web presence<\/li>\n<li>You want to use posts from a particular author, category, or tag for separate site(s)<\/li>\n<\/ul>\n<p>Skill Level: Beginner<\/p>\n<h2>Getting Started<\/h2>\n<p><strong>Update 3\/31\/17:<\/strong> If you are using WP 4.7 or above you can skip to step 3. The WP REST API is now part of core. No need for a plugin.<\/p>\n<ol>\n<li>Login to your WordPress site and add the <a href=\"https:\/\/wordpress.org\/plugins\/rest-api\/\">WP REST API V2 plugin<\/a><\/li>\n<li>Activate the plugin<br \/>\n<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-3018\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-1024x77.png\" alt=\"Activate WP REST API Plugin\" width=\"960\" height=\"72\" srcset=\"https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-1024x77.png 1024w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-300x23.png 300w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-768x58.png 768w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-645x49.png 645w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM-662x50.png 662w, https:\/\/digitalborn.wpenginepowered.com\/wp-content\/uploads\/2016\/06\/Screen-Shot-2016-06-20-at-1.11.13-PM.png 1960w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/li>\n<li>Find your route and define any endpoints. For our purposes, we&#8217;re going to retrieve all posts so we will use\n<pre>http:\/\/example.com\/wp-json\/wp\/v2\/posts\/<\/pre>\n<p>For example, to get all posts for this site, I will use<\/p>\n<pre><a href=\"http:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\">http:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts<\/a><\/pre>\n<p>Go ahead and copy and paste that URL into your browser. You&#8217;ll get a bunch of JSON data. That&#8217;s exactly what we want.<\/p>\n<p>Note that you can narrow down your results by\u00a0adding to the route. Quick terminology refresher:<\/p>\n<p>Base path of API:\u00a0http:\/\/example.com\/wp-json\/<br \/>\nRoute:\u00a0wp\/v2\/posts<\/p>\n<p>For example, we can grab just one post with the ID 2985 like this<\/p>\n<pre><a href=\"http:\/\/digitalborn.org\/wp-json\/wp-v2\/posts\/2985\">http:\/\/digitalborn.org\/wp-json\/wp-v2\/posts\/2985<\/a><\/pre>\n<p>Or, if we want to get posts with tag ID 139<\/p>\n<pre><a href=\"http:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts?tags=139\">http:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts?tags=139<\/a><\/pre>\n<p>For the full reference you can see the <a href=\"http:\/\/v2.wp-api.org\/reference\/posts\/\" target=\"_blank\" rel=\"noopener\">WP REST API documentation for posts<\/a><\/li>\n<li>Test the route in your browser. If you get post data, then we can move to the next step.Note: Only public posts will display. You can also display private posts but this is more complex and we won&#8217;t deal with private posts in this tutorial.<\/li>\n<\/ol>\n<h2>Get the Sample Files<\/h2>\n<p>I&#8217;ve added some files to get you started that allow you to simply paste the route you identified above and display posts.<\/p>\n<ol>\n<li>Clone or <strong>download the tutorial files<\/strong> located here<a href=\"https:\/\/github.com\/nathanegraham\/wp-rest-api-post-getter\">https:\/\/github.com\/nathanegraham\/wp-rest-api-post-getter<\/a>For those using the GitHub client you will click Open in Desktop. For those who do not use GitHub, just click Download Zip and then extract\/unzip the files<a href=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/github_repo_download.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3019\" src=\"http:\/\/digitalborn.org\/wp-content\/uploads\/2016\/06\/github_repo_download.gif\" alt=\"GitHub repo download\" width=\"474\" height=\"205\" \/><\/a><\/li>\n<li><strong>Open script.js<\/strong> in your favorite editor (Brackets is pretty great)<\/li>\n<li><strong>In Line 2, change the route<\/strong> to the one you identified in the Getting Started section above<\/li>\n<li>Hit <strong>Save<\/strong><\/li>\n<li>Now <strong>open index.html<\/strong> in your browser<\/li>\n<\/ol>\n<h2>Putting It All Together<\/h2>\n<p>Now that you have your JSON post data and you have the files to display this data on a webpage, you can add it to your site.<\/p>\n<ol>\n<li>Upload the Javascript files to your site&#8217;s directory.<br \/>\nIf you don&#8217;t have static web hosting I would recommend using AWS S3 or GitHub Pages. Both are free and easy to set up. I won&#8217;t go into the details but you can find instructions for <a href=\"http:\/\/docs.aws.amazon.com\/gettingstarted\/latest\/swh\/website-hosting-intro.html\">AWS S3 site hosting here<\/a> and <a href=\"https:\/\/pages.github.com\/\">GitHub Pages hosting here<\/a>.<\/li>\n<li>Open index.html and copy everything between the &lt;body&gt; tags<\/li>\n<li>Paste that HTML wherever you would like inside your webpage<\/li>\n<li>Now you will need to tweak the styles and formatting to match the rest of your existing site.For an example of a modified version of of the HTML in this tutorial, see my site<a href=\"http:\/\/nathanegraham.github.io\/\">http:\/\/nathanegraham.github.io\/<\/a>Notice that I have removed the image thumbnail and the excerpt. I&#8217;ve also moved the date before the post title.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Overview Have a WordPress site and want to include\u00a0your posts on an external site? In this tutorial, I will show you how to use the WordPress REST API to display your posts on a static site with just HTML, CSS, and Javascript. There are several scenarios where this might be useful but here are the [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":3020,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[162,143,49,114],"tags":[163,164,145],"class_list":["post-3017","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-data","category-design-2","category-tech-tips","tag-rest-api","tag-tutorial","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/comments?post=3017"}],"version-history":[{"count":0,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/posts\/3017\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media\/3020"}],"wp:attachment":[{"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/media?parent=3017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/categories?post=3017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalborn.org\/wp-json\/wp\/v2\/tags?post=3017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]