Webcom Mobi API Docs
RU
  • Introduction
  • СПОСОБЫ ВЗАИМОДЕЙСТВИЯ С A2P ПЛАТФОРМОЙ
    • JSON specification
      • Sending SMS, Viber, Flash SMS, WAP-Push
      • SMS status request
        • POST request
        • Webhook
      • Balance check request
    • HTTP GET specification
      • Sending SMS
      • Sending Viber
      • Sending Cascade
      • Request message status
      • Registration
    • XML specification
      • Sending SMS, Viber, Flash SMS, WAP-Push
      • SMS status request
        • POST request
        • Webhook
      • Balance check request
      • Request to receive a list of senders
      • Request to add senders
      • Request for incoming SMS
      • Request for information by phone number
      • Request for obtaining the list of bases
      • Request to change parameters, add/remove bases
      • Request for receiving the list of subscribers of the base
      • Request to add/edit/delete subscribers of the base
      • Request to get the list of numbers from the STOP list
      • Request to add/remove subscribers to the STOP list
      • Request to receive the list of scheduled SMS
      • Request to delete a scheduled SMS
      • Request to get the time of change of something
      • Request for time verification
      • File upload request
      • Request to refill users' balance
    • ВЗАИМОДЕЙСТВИЕ С ПЛАТФОРМОЙ MSG (НЕОФ КАНАЛЫ)
    • Specification JSON
      • Чекинг базы номеров
Powered by GitBook
On this page
  • File upload request
  • File upload example
  1. СПОСОБЫ ВЗАИМОДЕЙСТВИЯ С A2P ПЛАТФОРМОЙ
  2. XML specification

File upload request

To upload a file to the server, you need to send POST data containing login, password, file variables. The response will be the id of the saved file, which you can later use in xml-requests.

File upload request

POST http://lk.mysmpp.ru/xml/file.php

Request Body

Name
Type
Description

login*

String

Your login in the system

file*

data

File to be sent

token*

String

You can use a secret key instead of login and password. To obtain it, please contact your manager

password*

String

Your password in the system

The id of the added file in the system will be returned

-Failed to copy file

-Invalid login or password

File upload example

$href = "http://lk.mysmpp.ru/xml/file.php"; 
// (example: $tmpfname = "C:\Program Files\file\test.jpg";)
$tmpfname = "name";
$requist['login'] = "login";
$requist['passsword'] = "passsword";
if(PHP_VERSION_ID <  56000)
    $requist['file'] = '@' . $tmpfname;
else
    $requist['file'] = new CurlFile($tmpfname, 'image/jpg');  
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $href);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requist);
$result = curl_exec($ch);
curl_close($ch);
 
echo $result;

Last updated 1 year ago