title: How to post JSON POST API in PHP file
body: <pre><code>{
  "id": "4a59a50e-904a-674d-2553-8954ec4a841d",
  "name": "JSON API",
  "description": "",
  "order": [
      "155ae062-f839-ef5a-6c40-61e821202984"
  ],
  "folders": [],
  "folders_order": [],
  "timestamp": 1522932542555,
  "owner": 0,
  "public": false,
  "requests": [
      {
          "id": "155ae062-f839-ef5a-6c40-61e821202984",
          "headers": "Authorization: Basic OTE5MTAwMTkxY2OjEyMzQ1Ng==\n",
          "headerData": [
              {
                  "key": "Authorization",
                  "value": "Basic OTE5MTAwMTkxNjY2OyMzQ1Ng==",
                  "description": "",
                  "enabled": true
              }
          ],
          "url": "https://apiurl.in/bez/api/v1/documents/upload?disableSms=false",
          "queryParams": [
              {
                  "key": "disableSms",
                  "value": "false",
                  "equals": true,
                  "description": "",
                  "enabled": true
              }
          ],
          "preRequestScript": null,
          "pathVariables": {},
          "pathVariableData": [],
          "method": "POST",
          "data": [
              {
                  "key": "jsonData",
                  "value": "{\"phoneNumber\":\"9999999999\",\"merchantId\":\"1122112211\",\"amount\":100,\"billDate\":1514891788753,\"gender\":\"male\",\"ageGroup\":\"21-30\",\"dateOfBirth\":\"12-dec-1989\",\"email\":\"dfgd@gfdgfdg.in\",\"address\":\"dfg\"}",
                  "description": "Required fileds\n\"phoneNumber\",\"merchantId\",\"amount\",\"billDate\"\noptional fileds\n\"gender\",\"ageGroup\",\"dateOfBirth\",\"email\",\"address\"",
                  "type": "text",
                  "enabled": true
              },
              {
                  "key": "file",
                  "value": "",
                  "description": "",
                  "type": "file",
                  "enabled": true
              }
          ],
          "dataMode": "params",
          "tests": null,
          "currentHelper": "basicAuth",
          "helperAttributes": {
              "id": "basic",
              "username": "0101010101",
              "password": "30303030",
              "saveToRequest": true
          },
          "time": 1514892082233,
          "name": "Bill Uploading",
          "description": "",
          "collectionId": "4a59a50e-904a-674d-2553-8954ec4a841d",
          "responses": [],
          "collection_id": "4a59a50e-904a-674d-2553-8954ec4a841d"
      }
  ]
    }
  </code></pre>
  
  <p>Above code is in JSON file. I need to use the code in PHP file.</p>
  
  <p>Below code is in PHP. I don't know how to make a POST request through PHP.</p>
  
  <pre><code>public function sendSmsApi($array)
  {
      $data = array();
      $data['apikey'] = Configuration::get('Sendin_Api_Key');
      $data['to'] = $array['to'];
      $data['sender'] = Configuration::get('sender_id');
      $data['message'] = $array['text'];
      $data['type'] = 'xml';
  
      return Tools::jsonDecode($this-&gt;curlRequest($data));
  }
  </code></pre>
  
  <p>How to include JSON Data in PHP and make a POST request to the API URL.
  PHP code actually sends the message to customers. I want to include JSON code in PHP file to send A POST Request to API URL.</p>