{"id":114,"date":"2022-09-17T10:49:09","date_gmt":"2022-09-17T10:49:09","guid":{"rendered":"https:\/\/infobip.com\/developers\/?p=114"},"modified":"2023-09-11T14:35:22","modified_gmt":"2023-09-11T14:35:22","slug":"how-to-receive-sms-with-php-and-infobip","status":"publish","type":"post","link":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip","title":{"rendered":"How to receive SMS with PHP and Infobip"},"content":{"rendered":"\n<img decoding=\"async\" src=\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\" alt=\"php\"\/>\n\n\n\n<p>As an outcome of this guide, you will send an SMS message from your handset to a webhook. This will simulate a scenario in which an end user replies to a message and their reply is stored in a third-party application running on PHP.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>\u2022 <a href=\"https:\/\/www.infobip.com\/signup\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a><\/p>\n\n\n\n<p>\u2022 PHP, version 7.2 or greater<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Difficulty level<\/h2>\n\n\n\n<p>This guide assumes basic knowledge of PHP and basic familiarity with APIs. It is important, however, that you are familiar with the webhook technology and know how to use it for this project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Summary of the steps<\/h2>\n\n\n\n<p>\u2022 Buy a number capable of receiving incoming SMS traffic.<br>\u2022 Set up a webhook.<br>\u2022 Add webhook details to the number you&#8217;ve purchased.<br>\u2022 Receive an SMS on your webhook.<br>\u2022&nbsp;Install Infobip API PHP Client.<br>\u2022 Acces webhook with your PHP project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Buy a number<\/h2>\n\n\n\n<p>To buy a number, you&#8217;ll need to log into your <a href=\"https:\/\/portal.infobip.com\/\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a>.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Click on the <strong>Channels and Numbers<\/strong> icon on the left-hand side menu.<\/li>\n\n\n\n<li>On the <strong>Channels Essentials<\/strong> screen click <strong>Numbers<\/strong>.<\/li>\n\n\n\n<li>On the <strong>Numbers<\/strong> screen, click <strong>Buy Number<\/strong>.<\/li>\n\n\n\n<li>Set up filter options to narrow down your choices:<br>\u2022 Use <strong>Filter By Country<\/strong> to select the country you want to test the number in.<br>\u2022 Use <strong>Filter By Capability<\/strong> to select <strong>SMS<\/strong> as an option.<\/li>\n\n\n\n<li>Click <strong>Buy<\/strong> to finalize the purchase.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Set up a webhook<\/h2>\n\n\n\n<p>For experimenting, you could use a simple free tool like <a href=\"https:\/\/www.hookrelay.dev\/\" target=\"_blank\" rel=\"noopener\">Hook Relay<\/a>, but in this tutorial, we&#8217;ll use <a href=\"https:\/\/ngrok.com\/\" target=\"_blank\" rel=\"noopener\">ngrok<\/a> so we can write some PHP locally to receive these webhooks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1. Install ngrok<\/h3>\n\n\n\n<p>Install ngrok, then run a PHP server from the directory where that <code>webhook-incoming.php<\/code> code is sitting.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php -S localhost:8088<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2. Point ngrok at your local server<\/h3>\n\n\n\n<p>In another CLI session start up ngrok and point it at that server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ngrok http http:\/\/localhost:8088\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3. Generate a URL<\/h3>\n\n\n\n<p>The output will give you a URL, such as <code>Forwarding https:\/\/d5de-146-90-0-254.eu.ngrok.io -&gt; http:\/\/localhost:8088\/<\/code>. Copy the URL to finish setting up your webhook configuration for the number you have purchased from Infobip. In this case, you&#8217;ll use the following URL: <code>https:\/\/d5de-146-90-0-254.eu.ngrok.io\/webhook-incoming.php<\/code>. We will shortly explain why we&#8217;ve added the <code>webhook-incoming.php<\/code> bit to the URL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure your number with webhook details<\/h2>\n\n\n\n<p>Head back to your <a href=\"https:\/\/portal.infobip.com\/\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a> and access your number configuration page (Channels and Numbers &gt; Numbers).<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select the number you&#8217;ve purchased and click on <strong>Add Keyword<\/strong> to configure forwarding options. You can leave the <strong>Keyword<\/strong> field empty.<\/li>\n\n\n\n<li>Use the <strong>Forwarding<\/strong> dropdown to select the <strong>Forward to HTTP<\/strong> option. This will expand more options to configure.<\/li>\n\n\n\n<li>Select <strong>POST<\/strong> for a <strong>Method<\/strong>, and <strong>JSON<\/strong> as a <strong>Format<\/strong>.<\/li>\n\n\n\n<li>Under <strong>Forwarding<\/strong> provide the webhook&#8217;s URL.<\/li>\n\n\n\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Receive an SMS on your webhook<\/h2>\n\n\n\n<p>To test that all we have configured worked as expected, send an SMS from your handset to the number you have purchased. This should trigger an event, and you should see your message in a JSON format arriving at your webhook.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"results\": &#91;\n    {\n      \"messageId\": \"817790313235066447\",\n      \"from\": \"385916242493\",\n      \"to\": \"385921004026\",\n      \"text\": \"QUIZ Correct answer is Paris\",\n      \"cleanText\": \"Correct answer is Paris\",\n      \"keyword\": \"QUIZ\",\n      \"receivedAt\": \"2016-10-06T09:28:39.220+0000\",\n      \"smsCount\": 1,\n      \"price\": {\n        \"pricePerMessage\": 0,\n        \"currency\": \"EUR\"\n      },\n      \"callbackData\": \"callbackData\"\n    }\n  ],\n  \"messageCount\": 1,\n  \"pendingMessageCount\": 0\n}<\/code><\/pre>\n\n\n\n<p>That JSON can be deserialized and parsed any way you like, but the Infobip PHP SDK can do a lot of the hard work for you. To do that, we&#8217;ll need to install the SDK and authenticate Infobip SMS API.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add Infobip API PHP Client to your project<\/h2>\n\n\n\n<p>To use the <a href=\"https:\/\/github.com\/infobip\/infobip-api-php-client\" target=\"_blank\" rel=\"noopener\">Infobip API PHP Client<\/a> in your PHP project, you&#8217;ll need to add it to your project <code>composer.json<\/code> file, either directly or with this convenient command-line shortcut.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>composer require infobip\/infobip-api-php-client<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Create an InfobipConfiguration instance<\/h2>\n\n\n\n<p>You&#8217;ll use the instance to input your credentials and authenticate Infobip SMS API. Before running the code, don&#8217;t forget to replace the placeholders we set in the example below with your account values. You can find your API Key and API Base URL in your <a href=\"https:\/\/portal.infobip.com\/homepage\/\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a> or on the <a href=\"https:\/\/www.infobip.com\/docs\/api\" target=\"_blank\" rel=\"noopener\">Infobip API landing page<\/a>, once logged in.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nconst API_KEY_PREFIX = 'App';\nconst API_KEY = '&lt;your-api-key&gt;';\nconst URL_BASE_PATH = '&lt;your-base-URL&gt;';\n\n$configuration = (new InfobipConfiguration())\n    -&gt;setHost(URL_BASE_PATH)\n    -&gt;setApiKeyPrefix('Authorization', API_KEY_PREFIX)\n    -&gt;setApiKey('Authorization', API_KEY);\n\n$client = new GuzzleHttpClient();<\/code><\/pre>\n\n\n\n<p>Now that we&#8217;ve got the configuration done, the next step is configuring your project to listen to and catch webhook events.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Intercept a webhook with your local PHP server<\/h2>\n\n\n\n<p>Sending a text message to your newly purchased number should mean that a mobile carrier notifies Infobip, Infobip forwards a message to the configured ngrok URL, and that then forwards it to the local PHP server running an appropriate code. Let&#8217;s see it in action!<\/p>\n\n\n\n<p>Create a file called <code>webhook-incoming.php<\/code> in the same directory you just ran the <code>php -S ...<\/code> and that file will be accessible to ngrok.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nrequire \"vendor\/autoload.php\";\n\nuse InfobipObjectSerializer;\n\n$data = file_get_contents(\"php:\/\/input\");\n\n$type = 'InfobipModelSmsInboundMessageResult';\n$messages = ObjectSerializer::deserialize($data, $type);\n\nforeach ($messages-&gt;getResults() as $message) {\n    echo $message-&gt;getFrom() . \" - \" . $message-&gt; getCleanText() . \"n\";\n}<\/code><\/pre>\n\n\n\n<p>As a result, you should see your project intercepting the webhook event as soon as you send an SMS to the number you have purchased and configured for forwarding.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Thu Jun 16 09:09:22 2022] 447785374887 - Hello world!\n&#91;Thu Jun 16 09:09:22 2022] &#91;::1]:60030 &#91;200]: POST \/webhook-incoming.php\n&#91;Thu Jun 16 09:09:22 2022] &#91;::1]:60030 Closing<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Manually check for incoming messages<\/h2>\n\n\n\n<p>Instead of relying on webhooks, you can always manually check for an incoming traffic. You&#8217;d probably want to do that in situations where your system went down briefly for a deploy or crashed unexpectedly.<\/p>\n\n\n\n<p>Before running the solution, don&#8217;t forget to replace the placeholders we set with your account values. You can find your API Key and API Base URL either in your <a href=\"https:\/\/portal.infobip.com\/homepage\/\" target=\"_blank\" rel=\"noopener\">Infobip account<\/a> or on the <a href=\"https:\/\/www.infobip.com\/docs\/api\" target=\"_blank\" rel=\"noopener\">Infobip API landing page<\/a> once logged in.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use InfobipAPIReceiveSmsApi;\n\nconst API_KEY = '&lt;your-api-key&gt;';\nconst URL_BASE_PATH = '&lt;your-base-URL&gt;';\n\n$configuration = (new InfobipConfiguration())\n    -&gt;setHost(URL_BASE_PATH)\n    -&gt;setApiKeyPrefix('Authorization', API_KEY_PREFIX)\n    -&gt;setApiKey('Authorization', API_KEY);\n\n$client = new GuzzleHttpClient();\n$receiveSmsApi = new ReceiveSmsApi($client, $configuration);\n\ntry {\n    $smsIncoming = $receiveSmsApi-&gt;getInboundSmsMessages();\n    var_dump($smsIncoming);\n} catch (Throwable $apiException) {\n    var_dump($apiException);\n}<\/code><\/pre>\n\n\n\n<p>Running this code will show output that looks a bit like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>object(InfobipModelSmsInboundMessageResult)#44 (1) {\n  &#91;\"container\":protected]=&gt;\n  array(3) {\n    &#91;\"messageCount\"]=&gt;\n    int(0)\n    &#91;\"pendingMessageCount\"]=&gt;\n    int(0)\n    &#91;\"results\"]=&gt;\n    array(0) {\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<p>If there are no messages then job done, you&#8217;re fine. If there are some messages, you can process them through the same code that&#8217;s found in the webhook, and eventual consistency has been reached.<\/p>\n\n\n\n<p>And that&#8217;s basically it! You&#8217;re now successfully receiving messages from your customers with confidence.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As an outcome of this guide, you will send [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[12,255,15,264],"tags":[46,76],"coauthors":[133],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-guide","category-infobip-products","category-php","category-sms","tag-developer-docs","tag-sdk"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to receive SMS with PHP and Infobip - Infobip Developers Hub<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to receive SMS with PHP and Infobip - Infobip Developers Hub\" \/>\n<meta property=\"og:description\" content=\"As an outcome of this guide, you will send [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\" \/>\n<meta property=\"og:site_name\" content=\"Infobip Developers Hub\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/infobip\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-17T10:49:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-11T14:35:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\" \/>\n<meta name=\"author\" content=\"Infobip Devs\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:site\" content=\"@InfobipDev\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Infobip Devs\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\"},\"author\":{\"name\":\"Infobip Devs\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/e04a9012051f81b6a2f6976e156f6ce0\"},\"headline\":\"How to receive SMS with PHP and Infobip\",\"datePublished\":\"2022-09-17T10:49:09+00:00\",\"dateModified\":\"2023-09-11T14:35:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\"},\"wordCount\":868,\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\",\"keywords\":[\"developer docs\",\"SDK\"],\"articleSection\":[\"Guide\",\"Infobip Products\",\"PHP\",\"SMS\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\",\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\",\"name\":\"How to receive SMS with PHP and Infobip - Infobip Developers Hub\",\"isPartOf\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage\"},\"thumbnailUrl\":\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\",\"datePublished\":\"2022-09-17T10:49:09+00:00\",\"dateModified\":\"2023-09-11T14:35:22+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage\",\"url\":\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\",\"contentUrl\":\"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.infobip.com\/developers\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to receive SMS with PHP and Infobip\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#website\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"name\":\"Infobip Developers Hub\",\"description\":\"Build meaningful customer relationships across any channel\",\"publisher\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.infobip.com\/developers\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#organization\",\"name\":\"Infobip Developers Hub\",\"url\":\"https:\/\/www.infobip.com\/developers\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"contentUrl\":\"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png\",\"width\":696,\"height\":696,\"caption\":\"Infobip Developers Hub\"},\"image\":{\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/infobip\/\",\"https:\/\/x.com\/InfobipDev\",\"https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ\",\"https:\/\/github.com\/infobip-community\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/e04a9012051f81b6a2f6976e156f6ce0\",\"name\":\"Infobip Devs\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/f61078713800c4e479dce745cd206b82\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f29655934347a5aa15879f9af9ac1f05b87167e0f7ed4074a04132eaa9f631c4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f29655934347a5aa15879f9af9ac1f05b87167e0f7ed4074a04132eaa9f631c4?s=96&d=mm&r=g\",\"caption\":\"Infobip Devs\"},\"url\":\"https:\/\/www.infobip.com\/developers\/blog\/author\/infobip-devs\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to receive SMS with PHP and Infobip - Infobip Developers Hub","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:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip","og_locale":"en_US","og_type":"article","og_title":"How to receive SMS with PHP and Infobip - Infobip Developers Hub","og_description":"As an outcome of this guide, you will send [&hellip;]","og_url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip","og_site_name":"Infobip Developers Hub","article_publisher":"https:\/\/www.facebook.com\/infobip\/","article_published_time":"2022-09-17T10:49:09+00:00","article_modified_time":"2023-09-11T14:35:22+00:00","og_image":[{"url":"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue","type":"","width":"","height":""}],"author":"Infobip Devs","twitter_card":"summary_large_image","twitter_creator":"@InfobipDev","twitter_site":"@InfobipDev","twitter_misc":{"Written by":"Infobip Devs","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#article","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip"},"author":{"name":"Infobip Devs","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/e04a9012051f81b6a2f6976e156f6ce0"},"headline":"How to receive SMS with PHP and Infobip","datePublished":"2022-09-17T10:49:09+00:00","dateModified":"2023-09-11T14:35:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip"},"wordCount":868,"publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue","keywords":["developer docs","SDK"],"articleSection":["Guide","Infobip Products","PHP","SMS"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip","url":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip","name":"How to receive SMS with PHP and Infobip - Infobip Developers Hub","isPartOf":{"@id":"https:\/\/www.infobip.com\/developers\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage"},"thumbnailUrl":"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue","datePublished":"2022-09-17T10:49:09+00:00","dateModified":"2023-09-11T14:35:22+00:00","breadcrumb":{"@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#primaryimage","url":"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue","contentUrl":"https:\/\/img.shields.io\/badge\/php-%3E%3D7.2-blue"},{"@type":"BreadcrumbList","@id":"https:\/\/www.infobip.com\/developers\/blog\/how-to-receive-sms-with-php-and-infobip#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.infobip.com\/developers\/"},{"@type":"ListItem","position":2,"name":"How to receive SMS with PHP and Infobip"}]},{"@type":"WebSite","@id":"https:\/\/www.infobip.com\/developers\/#website","url":"https:\/\/www.infobip.com\/developers\/","name":"Infobip Developers Hub","description":"Build meaningful customer relationships across any channel","publisher":{"@id":"https:\/\/www.infobip.com\/developers\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.infobip.com\/developers\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.infobip.com\/developers\/#organization","name":"Infobip Developers Hub","url":"https:\/\/www.infobip.com\/developers\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/","url":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","contentUrl":"https:\/\/www.infobip.com\/developers\/wp-content\/uploads\/2023\/03\/Infobip_logo_favicon.png","width":696,"height":696,"caption":"Infobip Developers Hub"},"image":{"@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/infobip\/","https:\/\/x.com\/InfobipDev","https:\/\/www.youtube.com\/channel\/UCUPSTy53VecI5GIir3J3ZbQ","https:\/\/github.com\/infobip-community"]},{"@type":"Person","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/e04a9012051f81b6a2f6976e156f6ce0","name":"Infobip Devs","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.infobip.com\/developers\/#\/schema\/person\/image\/f61078713800c4e479dce745cd206b82","url":"https:\/\/secure.gravatar.com\/avatar\/f29655934347a5aa15879f9af9ac1f05b87167e0f7ed4074a04132eaa9f631c4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f29655934347a5aa15879f9af9ac1f05b87167e0f7ed4074a04132eaa9f631c4?s=96&d=mm&r=g","caption":"Infobip Devs"},"url":"https:\/\/www.infobip.com\/developers\/blog\/author\/infobip-devs"}]}},"_links":{"self":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":5,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":2546,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/posts\/114\/revisions\/2546"}],"wp:attachment":[{"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/tags?post=114"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.infobip.com\/developers\/wp-json\/wp\/v2\/coauthors?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}