コード例 #1
0
 /**
  * @param array $options Custom options to apply to the description
  *     - formatter: Can provide a custom SchemaFormatter class
  */
 public function __construct(array $options = [])
 {
     parent::__construct(['name' => 'prostor-sms.ru API', 'baseUrl' => 'http://api.prostor-sms.ru', 'operations' => ['version' => ['httpMethod' => 'GET', 'uri' => '/messages/v2/version/', 'description' => 'Проверка активной версии API. При успешной авторизации, в ответ сервис должен вернуть plain/text ответ вида: "2", где выводится номер активной версии API', 'responseModel' => 'getResponse'], 'balance' => ['httpMethod' => 'GET', 'uri' => '/messages/v2/balance/', 'description' => 'Проверка состояния счета. При успешной авторизации, в ответ сервис должен вернуть plain/text ответ вида: "RUB;540.15;0.0\\nSMS;589;100", где в каждой строке 1 значение – тип баланса, 2 значение – баланс, 3 значение – кредит (возможность использовать сервис при отрицательномбалансе)', 'responseModel' => 'getResponse'], 'send' => ['httpMethod' => 'GET', 'uri' => '/messages/v2/send/', 'description' => 'Передача сообщения. При успешной авторизации, в ответ сервис должен вернуть plain/text ответ вида accepted;A132571BC', 'responseModel' => 'getResponse', 'parameters' => ['statusQueueName' => ['type' => 'string', 'location' => 'json', 'required' => false, 'min' => 3, 'max' => 16, 'description' => 'Название очереди статусов отправленных сообщений, в случае, если вы хотите использовать очередь статусов отправленных сообщений. От 3 до 16 символов, буквы и цифры (например myQueue1)'], 'scheduleTime' => ['type' => 'string', 'location' => 'json', 'required' => false, 'description' => 'Дата для отложенной отправки сообщения, в UTC (2008-07-12T14:30:01Z)'], 'messages' => ['type' => 'array', 'location' => 'json', 'required' => true, 'items' => ['clientId' => ['type' => 'string', 'location' => 'json', 'required' => true, 'description' => 'ID в вашей системе'], 'phone' => ['type' => 'string', 'location' => 'json', 'required' => true, 'description' => 'Номер телефона, в формате +71234567890'], 'text' => ['type' => 'string', 'location' => 'json', 'required' => true, 'description' => 'Текст сообщения, в UTF-8 кодировке'], 'sender' => ['type' => 'string', 'location' => 'json', 'required' => false, 'description' => 'Подпись отправителя (например TEST)']]]]]], 'models' => ['getResponse' => ['type' => 'object', 'properties' => ['additionalProperties' => ['location' => 'body']]]]], $options);
 }
コード例 #2
0
 public function __construct(array $config, array $options = [])
 {
     $config = $this->normalizeConfig($config);
     parent::__construct($config, $options);
 }
コード例 #3
0
 /**
  * @param string $baseUrl
  */
 public function __construct($baseUrl = 'http://api.viewranger.com/public/v1/')
 {
     parent::__construct(['baseUrl' => $baseUrl, 'operations' => ['getLastBBPosition' => ['httpMethod' => 'GET', 'responseModel' => 'getResponse', 'parameters' => ['service' => ['required' => true, 'static' => true, 'name' => 'service', 'default' => 'getLastBBPosition', 'location' => 'query'], 'username' => ['type' => 'string', 'required' => true, 'location' => 'query'], 'pin' => ['required' => true, 'type' => 'integer', 'location' => 'query']]], 'getBBPositions' => ['httpMethod' => 'GET', 'responseModel' => 'getResponse', 'parameters' => ['service' => ['required' => true, 'static' => true, 'name' => 'service', 'default' => 'getBBPositions', 'location' => 'query'], 'username' => ['required' => true, 'type' => 'string', 'location' => 'query'], 'pin' => ['required' => true, 'type' => 'integer', 'location' => 'query'], 'date_from' => ['type' => 'string', 'location' => 'query'], 'date_until' => ['type' => 'string', 'location' => 'query'], 'limit' => ['type' => 'integer', 'location' => 'query']]]], 'models' => ['getResponse' => ['type' => 'object', 'additionalProperties' => ['location' => 'json']]]]);
 }
コード例 #4
0
ファイル: MaibDecription.php プロジェクト: slavic18/MaibAPI
 /**
  * @param array $options Custom options to apply to the description
  *     - formatter: Can provide a custom SchemaFormatter class
  */
 public function __construct(array $options = [])
 {
     parent::__construct(['name' => 'Maib API', 'operations' => ['registerSmsTransaction' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'identifies the request for register SMS transaction', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'amount' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'currency' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'client_ip_addr' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 15], 'description' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 125], 'language' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 32]]], 'registerDmsAuthorization' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'identifies the request for register DMS transaction', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'amount' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 12], 'currency' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 3], 'client_ip_addr' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 15], 'description' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 125], 'language' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 32]]], 'makeDMSTrans' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'identifies the request for execute DMS transaction', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'auth_id' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'amount' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 12], 'currency' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 3], 'client_ip_addr' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 15], 'description' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 125], 'language' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 32]]], 'getTransactionResult' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'identifies the request for get transaction result', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'trans_id' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'client_ip_addr' => ['type' => 'string', 'location' => 'postField', 'required' => true, 'max' => 15]]], 'revertTransaction' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'identifies the request for revert transaction', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'trans_id' => ['type' => 'string', 'location' => 'postField', 'required' => true], 'amount ' => ['type' => 'string', 'location' => 'postField', 'required' => false, 'max' => 12]]], 'closeDay' => ['httpMethod' => 'POST', 'uri' => '/ecomm2/MerchantHandler', 'description' => 'End of business day', 'responseModel' => 'getResponse', 'parameters' => ['command' => ['type' => 'string', 'location' => 'postField', 'required' => true]]]], 'models' => ['getResponse' => ['type' => 'object', 'properties' => ['additionalProperties' => ['location' => 'body']]]]], $options);
 }
コード例 #5
0
 public function __construct($baseUrl = 'http://vindinium.org/', array $options = [])
 {
     parent::__construct(array_merge(['baseUrl' => $baseUrl], $this->toArray()), $options);
 }