📜 ⬆️ ⬇️

API for uploading music to Veborama

We inform you that the SOAP API for uploading files to Webcam has come out of the alpha testing stage. Now everyone can equip their development with a mechanism for uploading music to Webcam.



So, the most important thing is that the descriptions of our API on wsdl are located at: www.weborama.ru/soapAPI (this is not a link, just the name of the repository in which the WSDL descriptions lie). At the moment, there are descriptions of 3 services:
')
  1. login
  2. music downloader
  3. and one more


It is worth being prepared for the fact that in the event of a contingency situation, an error in the committed data and other troubles is thrown an exception describing the error.

Authorization service



Description (wsdl diagram) - www.weborama.ru/soapAPI/login.wsdl . The service allows you to authorize by email and password, check the session keys for health and, upon completion of operations, “unlocking”.

Example (in php)

$soapLoginClient = new SoapClient( 'http://www.weborama.ru/soapAPI/login.wsdl' , array( 'encoding' => 'UTF-8' , 'trace' => true , 'exceptions' => true ));
/**
* - $sessionHash -
*/
$sessionHash = $soapLoginClient->login( 'someone@mail.ru' , '_' );
/**
*
*/
$soapLoginClient->checkSession($sessionHash);
/**
*
*/
$soapLoginClient->logout($sessionHash);

* This source code was highlighted with Source Code Highlighter .


Music Download Service



Description (wsdl diagram) - www.weborama.ru/soapAPI/uploadAudio.wsdl . The service allows you to check for the presence of a song on the Select server and download files.

Example (in php)

$soapClient = new SoapClient( 'http://www.weborama.ru/soapAPI/uploadAudio.wsdl' , array( 'encoding' => 'UTF-8' , 'trace' => true , 'exceptions' => true ));
/**
*
*/
$soapClient->__setCookie( 'sessionHash' , _);

/**
*
*/
$data = new stdClass();
$data->fileName = $fileName;
$data->offset = $offset;
$data->length = $size;
$data->data = fread($fileHandler, $size);
$data->data = base64_encode($data->data);

$soapClient->uploadFile($data);

/**
* -
*/
$fileHash = $soapClient->completeFile($sessionHash, $data);

/**
* ()
*/
$fileHashes = array($fileHash);
$result = $soapClient->completeUpload($sessionHash, array($fileHash));

/**
*
*/
$songInfo = new stdClass();
$songInfo->artist = '' ;
$songInfo->album = 'Let It Be' ;
$songInfo->year = '1970' ;
$songInfo->song = 'Two Of Us' ;

$songExists = $soapClient->songExists($songInfo);

/**
*
*/
$songInfo = new stdClass();
$songInfo->uniqueName = '7b1c2da40b3200a60d38e47760e0f161' ;

$songExists = $soapClient->songExists($songInfo);


* This source code was highlighted with Source Code Highlighter .

Source: https://habr.com/ru/post/58856/


All Articles