{"id":1567,"date":"2018-12-05T00:00:00","date_gmt":"2018-12-04T23:00:00","guid":{"rendered":"https:\/\/old.weichie.com\/blog\/curl-api-calls-authentication\/"},"modified":"2020-06-26T06:32:33","modified_gmt":"2020-06-26T05:32:33","slug":"php-curl-api-calls-authentication","status":"publish","type":"post","link":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/","title":{"rendered":"PHP cURL API calls with authentication (REST GET POST)"},"content":{"rendered":"\n<p>If you&#8217;re here because you want to connect your php code to an external API, please check my <a href=\"https:\/\/www.weichieprojects.com\/blog\/curl-api-calls-with-php\/\">cURL api-calls with php<\/a>&nbsp;tutorial first. This is part 2 of how to connect to an API using cURL in php, as I received a lot of questions on how to connect if the API requires authentication (utoken) first.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Heads up<\/strong>: This time, I will be using Javascript for more flexibility. As I need to make an &#8216;authentication&#8217; api call first before our initial GET call. Therefore I create my API calls in my own php files on the side, and will target these files using ES6 async\/fetch from within my page. If you see me linking to my-site.com, this means I created the file myself, on my own server. If I&#8217;m linking to api-site.com, this means I&#8217;m making a call the the external API.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/07\/api_2.jpg\" alt=\"cURL Authentication\" class=\"wp-image-734\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Generating an auth key<\/h2>\n\n\n\n<p>Some API&#8217;s only allow POST or GET requests if you use an <strong>auth-token<\/strong>. We need to generate this auth-token first, before we are allowed to make API calls. Normally the API docs should explain how you can generate their auth-token. In my example, I can generate an auth-token by posting my API client ID, client_secret and a login type to their API Auth file.<\/p>\n\n\n\n<p>Here is how I can generate and use my auth-token, based on the cURL script of my <a href=\"https:\/\/www.weichieprojects.com\/blog\/curl-api-calls-with-php\/\">part-1 tutorial<\/a>. In this tutorial, I&#8217;ll be calling this file <strong>api\/auth.php<\/strong><\/p>\n\n\n\n<pre><code class=\"language-php\">$curl = curl_init();\n$auth_data = array(\n\t'client_id' \t\t=&gt; 'XBnKaywRCrj05mM-XXX-6DXuZ3FFkUgiw45',\n\t'client_secret' \t=&gt; 'btHTWVNMUATHEnF-XXX-2nQabKcKVo3VXtU',\n\t'grant_type' \t\t=&gt; 'client_credentials'\n);\ncurl_setopt($curl, CURLOPT_POST, 1);\ncurl_setopt($curl, CURLOPT_POSTFIELDS, $auth_data);\ncurl_setopt($curl, CURLOPT_URL, 'https:\/\/api-site.com\/oauth\/token');\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n$result = curl_exec($curl);\nif(!$result){die(\"Connection Failure\");}\ncurl_close($curl);\necho $result;<\/code><\/pre>\n\n\n\n<p>This will return an auth-token for me. With this auth token, I can start making normal API calls like POST and GET. However.. My example API only keeps my auth-token alive for 2 weeks AND will only allow 3 auth-tokens at a time. So for each call I make, I need to regenerate this. This is why I&#8217;m using JS as example, so we can easily quickly generate the AUTH token before our own call. For this, I have a separate JS function to post to our own api\/auth.php: <strong>JS<\/strong><\/p>\n\n\n\n<pre><code class=\"language-php\">const apiAuth = async () =&gt; {\n  try{\n    const response  = await fetch('https:\/\/my-site.com\/api\/auth.php');\n    if(response.ok){\n      return response.json();\n    }\n    throw new Error(`apiAuth_response: ${response}`);\n  }catch(error){\n    console.error(`apiAuth: ${error}`);\n  }\n}<\/code><\/pre>\n\n\n\n<p>This is the JS-script and the PHP-script I&#8217;m using to generate an auth-token for my API. I&#8217;m using await to make sure our script only continuous when we do have received the Auth token. If we don&#8217;t await this token, it&#8217;s possible the rest of our script will already try to make the API call without the utoken, and will return errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to use our Auth-token?<\/h2>\n\n\n\n<p>Ok good, now we have an auth-token for our app&#8230; How do we use this?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL GET request (with Authentication)<\/h3>\n\n\n\n<p>In most cases (I think) you need to add your auth-token to the url you&#8217;re using to make a valid API call. Again, you should be able to find this in the documentation of the API your using. In my example, if I want to make an API call, my link should look like this: <strong>api\/get_all_reviews.php<\/strong><\/p>\n\n\n\n<pre><code class=\"language-php\">https:\/\/api-site.com\/v1\/apps\/' . $app_key . '\/reviews?utoken=' . $utoken;<\/code><\/pre>\n\n\n\n<p>We do know our $app_key and we just generated our $utoken. So our .php file to make the GET-call would look like this: ($_POST[&#8216;auth_token&#8217;] will be our received utoken from our previous function.<\/p>\n\n\n\n<pre><code class=\"language-php\">if(isset($_POST['access_token'])){\t\n\t$app_key  = 'XBnKaywRCrj05m-XXX-v6DXuZ3FFkUgiw45';\n\t$utoken = $_POST['access_token'];\n\t$url = 'https:\/\/api-site.com\/v1\/apps\/' . $app_key . '\/reviews?utoken=' . $utoken;\n\t\n\t$curl = curl_init();\n   curl_setopt($curl, CURLOPT_URL, $url);\n   curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n   curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n   $result = curl_exec($curl);\n   if(!$result){die(\"Connection Failure\");}\n   curl_close($curl);\n   echo $result;\n}<\/code><\/pre>\n\n\n\n<p>This will return all our product-reviews in the example I picked for this tutorial. Now we still need to target this GET php file with our JS and don&#8217;t forget to generate our utoken first! <strong>JS<\/strong><\/p>\n\n\n\n<pre><code class=\"language-javascript\">const getAllReviews = async () =&gt; {\n  const auth = await apiAuth();\n  const data = {\n    access_token: auth.access_token,\n    token_type: auth.token_type,\n  }\n  try{\n    $.post({\n      type: 'POST',\n      url: 'http:\/\/my-site.com\/api\/get_all_reviews.php',\n      data: data\n    })\n    .success(res =&gt; {\n      const data = JSON.parse(res);\n      const reviews = data.reviews;\n      displayAllReviews(reviews, $('.review-list'));\n    });\n  }catch(error){\n    console.error(`getAllReviews: ${error}`);\n  }\n}<\/code><\/pre>\n\n\n\n<p>As you can see we await the Auth function again, before we continue with our original API call. We post the received auth.access_token together with our form data to our GET php script. The displayAllReviews() is a random function, that I am passing our received data to. So here you can call your own functions, depending on what you want to do with this data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">cURL POST request (with Authentication)<\/h3>\n\n\n\n<p>Same for POST as with GET, we need to add our utoken (Auth-token) to the url. Here is an example of my POST link to the API, with my utoken:&nbsp;<strong>api\/post_review.php<\/strong><\/p>\n\n\n\n<pre><code class=\"language-php\">if(isset($_POST['success'])){\t\n\t$p_url = 'https:\/\/product-link.com';\n\t$email = $_POST['email'];\n\t\n\t$post_array = array(\n\t\t'appkey' =&gt; 'XBnKaywRCrj05m-XXX-v6DXuZ3FFkUgiw45',\n\t\t'domain' =&gt; 'https:\/\/api-site.com',\n\t\t'product_url' =&gt; $p_url,\n\t\t'email' =&gt; $email,\n\t\t'review_content' =&gt; $_POST['message'],\n\t\t'review_title' =&gt; $_POST['title'],\n\t\t'review_score' =&gt; $_POST['star_rating_value']\n\t);\n\tpostReview($post_array);\n}else{\n\t$response = array(\n\t\t'response' \t=&gt; 'error',\n\t\t'message'\t=&gt; 'POST is required to use this function'\n\t);\n}\nfunction postReview($post_array){\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_POST, 1);\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $post_array);\n\tcurl_setopt($curl, CURLOPT_URL, 'https:\/\/api-site.com\/v1\/reviews');\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\n\t$result = curl_exec($curl);\n\tif(!$result){die(\"Connection Failure\");}\n\tcurl_close($curl);\n\techo $result;\n}<\/code><\/pre>\n\n\n\n<p>To make a POST, I first gather all the information I need to make the post. (like user-email and the product URL I want to post a review for). When I have all the data, I call the postReview function, that will make the POST API call. We need to gather all this data up-front, otherwise we are not allowed to make our API call. As our POST request doesn&#8217;t require a utoken variable.<\/p>\n\n\n\n<p>Now the JS script I used for this: <strong>JS<\/strong><\/p>\n\n\n\n<pre><code class=\"language-javascript\">function postSiteReview(data, form){\n  $.ajax({\n    url: 'https:\/\/my-site.com\/api\/post_review.php',\n    type: 'post',\n    data: data,\n    success: function(result){\n      let res = JSON.parse(result);\n      let message = '';\n      if(res.code === 200){\n        form.find('.success-message').fadeIn();\n      }else{\n        if(res.response === 'error'){\n          message = res.message;\n        }\n        if(res.status &amp;&amp; res.status.code === 500){\n          message = res.status.message;\n        }\n        $('p.error-msg').text(`Uh ooh.. ${message}`);\n      }\n    },\n    error: function(err){\n      console.log('$.ajax error: ' + err);\n    }\n  });\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">No Access-Control-Allow-Origin header is present &#8211; (CORS)<\/h2>\n\n\n\n<p>If you&#8217;re making JS calls to your own php-files, but your files are on a different server, please at following line at the top of each .php file you&#8217;re using:<\/p>\n\n\n\n<pre><code class=\"language-php\">header(\"Access-Control-Allow-Origin: https:\/\/my-site.com\");<\/code><\/pre>\n\n\n\n<p>This should fix the access-control error you&#8217;re seeing in the js-console.<\/p>\n\n\n\n<p>I really hope this part is well-explained as well. If not, please feel free to ask in the comments. (I can not guarantee you will get a response).<\/p>\n\n\n\n<p>Let me know if it works for you.<br>\nHappy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re here because you want to connect your php code to an external API, please check my cURL api-calls with php&nbsp;tutorial first. This is part 2 of how to connect to an API using cURL in php, as I received a lot of questions on how to connect if the API requires authentication (utoken) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":972,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[104],"tags":[113,170,168,180,96,123,98,181],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.4 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP cURL API calls with authentication (REST GET POST) &#8212; Weichie - Digital Agency Brussels<\/title>\n<meta name=\"description\" content=\"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP cURL API calls with authentication (REST GET POST)\" \/>\n<meta property=\"og:description\" content=\"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\" \/>\n<meta property=\"og:site_name\" content=\"Weichie\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/weichiecom\" \/>\n<meta property=\"article:published_time\" content=\"2018-12-04T23:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-06-26T05:32:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/07\/api_2_1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1080\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bob Weichler\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"cURL API calls with authentication in php (GET POST) - Bob Weichler\" \/>\n<meta name=\"twitter:description\" content=\"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.weichieprojects.com\/wp-content\/uploads\/2018\/12\/api_2_1.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@Weichiie\" \/>\n<meta name=\"twitter:site\" content=\"@Weichiie\" \/>\n<meta name=\"twitter:label1\" content=\"Geschreven door\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bob Weichler\" \/>\n\t<meta name=\"twitter:label2\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\"},\"author\":{\"name\":\"Bob Weichler\",\"@id\":\"https:\/\/old.weichie.com\/nl\/#\/schema\/person\/6ad8396db109092b3b23f7ea9e6b8f2a\"},\"headline\":\"PHP cURL API calls with authentication (REST GET POST)\",\"datePublished\":\"2018-12-04T23:00:00+00:00\",\"dateModified\":\"2020-06-26T05:32:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\"},\"wordCount\":855,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/#organization\"},\"keywords\":[\"api\",\"authentication\",\"ES6\",\"get\",\"javascript\",\"json\",\"php\",\"post\"],\"articleSection\":[\"New York City\"],\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\",\"url\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\",\"name\":\"PHP cURL API calls with authentication (REST GET POST) &#8212; Weichie - Digital Agency Brussels\",\"isPartOf\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/#website\"},\"datePublished\":\"2018-12-04T23:00:00+00:00\",\"dateModified\":\"2020-06-26T05:32:33+00:00\",\"description\":\"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.\",\"breadcrumb\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/old.weichie.com\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP cURL API calls with authentication (REST GET POST)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/old.weichie.com\/nl\/#website\",\"url\":\"https:\/\/old.weichie.com\/nl\/\",\"name\":\"Weichie\",\"description\":\"Web development for forward thinking brands\",\"publisher\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/old.weichie.com\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/old.weichie.com\/nl\/#organization\",\"name\":\"Weichie\",\"url\":\"https:\/\/old.weichie.com\/nl\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/old.weichie.com\/nl\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/04\/wp_logo_black.png\",\"contentUrl\":\"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/04\/wp_logo_black.png\",\"width\":500,\"height\":228,\"caption\":\"Weichie\"},\"image\":{\"@id\":\"https:\/\/old.weichie.com\/nl\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/weichiecom\",\"https:\/\/twitter.com\/Weichiie\",\"https:\/\/www.instagram.com\/weichiie\/\",\"https:\/\/www.linkedin.com\/company\/weichieprojects\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/old.weichie.com\/nl\/#\/schema\/person\/6ad8396db109092b3b23f7ea9e6b8f2a\",\"name\":\"Bob Weichler\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PHP cURL API calls with authentication (REST GET POST) &#8212; Weichie - Digital Agency Brussels","description":"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"nl_NL","og_type":"article","og_title":"PHP cURL API calls with authentication (REST GET POST)","og_description":"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.","og_url":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/","og_site_name":"Weichie","article_publisher":"https:\/\/www.facebook.com\/weichiecom","article_published_time":"2018-12-04T23:00:00+00:00","article_modified_time":"2020-06-26T05:32:33+00:00","og_image":[{"width":1080,"height":1080,"url":"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/07\/api_2_1.jpg","type":"image\/jpeg"}],"author":"Bob Weichler","twitter_card":"summary_large_image","twitter_title":"cURL API calls with authentication in php (GET POST) - Bob Weichler","twitter_description":"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.","twitter_image":"https:\/\/www.weichieprojects.com\/wp-content\/uploads\/2018\/12\/api_2_1.jpg","twitter_creator":"@Weichiie","twitter_site":"@Weichiie","twitter_misc":{"Geschreven door":"Bob Weichler","Geschatte leestijd":"6 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#article","isPartOf":{"@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/"},"author":{"name":"Bob Weichler","@id":"https:\/\/old.weichie.com\/nl\/#\/schema\/person\/6ad8396db109092b3b23f7ea9e6b8f2a"},"headline":"PHP cURL API calls with authentication (REST GET POST)","datePublished":"2018-12-04T23:00:00+00:00","dateModified":"2020-06-26T05:32:33+00:00","mainEntityOfPage":{"@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/"},"wordCount":855,"commentCount":0,"publisher":{"@id":"https:\/\/old.weichie.com\/nl\/#organization"},"keywords":["api","authentication","ES6","get","javascript","json","php","post"],"articleSection":["New York City"],"inLanguage":"nl-NL","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/","url":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/","name":"PHP cURL API calls with authentication (REST GET POST) &#8212; Weichie - Digital Agency Brussels","isPartOf":{"@id":"https:\/\/old.weichie.com\/nl\/#website"},"datePublished":"2018-12-04T23:00:00+00:00","dateModified":"2020-06-26T05:32:33+00:00","description":"My previous cURL API call with PHP post got so much traffic, I received a lot of questions about how you could add authentication to the cURL API calls.","breadcrumb":{"@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/old.weichie.com\/nl\/blog\/php-curl-api-calls-authentication\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/old.weichie.com\/nl\/"},{"@type":"ListItem","position":2,"name":"PHP cURL API calls with authentication (REST GET POST)"}]},{"@type":"WebSite","@id":"https:\/\/old.weichie.com\/nl\/#website","url":"https:\/\/old.weichie.com\/nl\/","name":"Weichie","description":"Web development for forward thinking brands","publisher":{"@id":"https:\/\/old.weichie.com\/nl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/old.weichie.com\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/old.weichie.com\/nl\/#organization","name":"Weichie","url":"https:\/\/old.weichie.com\/nl\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/old.weichie.com\/nl\/#\/schema\/logo\/image\/","url":"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/04\/wp_logo_black.png","contentUrl":"https:\/\/old.weichie.com\/wp-content\/uploads\/2019\/04\/wp_logo_black.png","width":500,"height":228,"caption":"Weichie"},"image":{"@id":"https:\/\/old.weichie.com\/nl\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/weichiecom","https:\/\/twitter.com\/Weichiie","https:\/\/www.instagram.com\/weichiie\/","https:\/\/www.linkedin.com\/company\/weichieprojects\/"]},{"@type":"Person","@id":"https:\/\/old.weichie.com\/nl\/#\/schema\/person\/6ad8396db109092b3b23f7ea9e6b8f2a","name":"Bob Weichler"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/posts\/1567"}],"collection":[{"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/comments?post=1567"}],"version-history":[{"count":2,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/posts\/1567\/revisions"}],"predecessor-version":[{"id":2960,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/posts\/1567\/revisions\/2960"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/media\/972"}],"wp:attachment":[{"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/media?parent=1567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/categories?post=1567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/old.weichie.com\/nl\/wp-json\/wp\/v2\/tags?post=1567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}