FSBtoERP - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of FSBtoERP.php

  1. <?php
  2. $url = 'http://education-erp.com/api/LandingService/v1/SingleRequest';
  3.  
  4. // параметры запроса
  5. $args = [
  6.     // параметры запроса
  7.        'body' => [
  8.             "CityId" => null,
  9.             "SchoolId" => 16348,
  10.             "Name" => 'Тест Алексей',
  11.             "ChildName" => null,
  12.             "Phone" => '+77777777777',
  13.             "Type" => 2,
  14.             "Email" => null,
  15.             "SchoolType" => null,
  16.             "UtmSource" => null,
  17.             "UtmCampaign" => null,
  18.             "UtmContent" => null,
  19.             "UtmMedium" => null,
  20.             "UtmTerm" => null,
  21.             "PromoCode" => null,
  22.             "Comment" => null
  23.     ],
  24.     
  25. ];
  26.  
  27. $response = wp_remote_post( $url, $args );
  28. // проверка ошибки
  29. if ( is_wp_error( $response ) ) {
  30.    $error_message = $response->get_error_message();
  31.    echo "Что-то пошло не так: $error_message";
  32. } else {
  33.    echo 'Ответ: <pre>';
  34.    print_r( $response );
  35.    echo '</pre>';
  36. }
File Description
  • FSBtoERP
  • PHP Code
  • 23 Sep-2022
  • 1008 Bytes
You can Share it: