ideabiz/sms 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ideabiz/sms

Composer 安装命令:

composer require ideabiz/sms

包简介

PHP helper classes for ideabiz/sms api integration

README 文档

README

#IdeaBiz PHP sample

This will handle the API call. and also it handle to token. If need,it will refresh existing token automatically . So you only need to make API call via this SDK

##Configuration

  • Make config.json and lib/data.json writable
  • Change config.json files properties based on your application

To get refresh token, you have to use token api with username once refer Documentation

Use

Once config.json is configured, you can include IdeaBizAPIHandler.php to your code. then call sendAPICall method

For example

include 'IdeaBizAPIHandler.php';
$auth = new IdeaBizAPIHandler();
$out = $auth->sendAPICall($url,RequestMethod::POST,$body);

Parameters

URL

complete URL of ideabiz api. Example for sms https://ideabiz.lk/apicall/smsmessaging/v1/outbound/94777123456/requests

Method

its a HTTP method. you can use RequestMethod Enum for that. this accepts string as well such as "POST and "GET". RequestMethod enum contains

RequestMethod::POST
RequestMethod::GET
RequestMethod::DELETE
RequestMethod::PUT

Body

this is a plain string that contains any payload. If you need to send an object please json_encode it.

$out = $auth->sendAPICall($url,RequestMethod::POST,json_encode($obj));

Response

Result returns as array.

Success

 $result['status'] 
 $result['statusCode'] 
 $result['time']
 $result['header']
 $result['body']

status

this contains OK for success

Status Code

this contains http status code. eg : 200, 400 like that

Time

Time taken to complete the request

Headers

HTTP headers that returns by the server

Body

body is in plain text. if you have an object, you can use json_decode

Error

this happens if connection fails or an error occurs other than the Authentication failures

 $result['status'] 
 $result['error'] 

status

The string value "ERROR" is given for the Errors

error

this contain error description

Exceptions

This returns two types of exceptions if any authentication errors

its

AuthenticationException
ConnectionException

Example code

Please refer test.php

统计信息

  • 总下载量: 16
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 9
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2017-06-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固