Hoiio SDK in Go
Go1
Install go-gb
and compile the package.
$ gb
The package will be in the _obj
folder.
Create a HoiioRestClient.
The HoiioRestClient needs your Hoiio credentials. You must pass these directly to the constructor.
import . "go-hoiio/impl"
appid := "YOUR_APPID_HERE"
token := "YOUR_TOKEN_HERE"
client := NewClient(appid, token)
import (
"net/url"
. "go-hoiio/impl"
)
appid := "YOUR_APPID_HERE"
token := "YOUR_TOKEN_HERE"
client := NewClient(appid, token)
voiceService := NewVoice(client)
data := url.Values{
"dest" : {"+6512345678"},
"dest2": {"+6554326547"},
"caller_id": {"Trong Dao"},
}
resp = voiceService.call(data)
import (
"net/url"
. "go-hoiio/impl"
)
appid := "YOUR_APPID_HERE"
token := "YOUR_TOKEN_HERE"
client := NewClient(appid, token)
smsService := NewSms(client)
data := url.Values{
"dest" : {"+6512345678"},
"msg": {"Hello, how are you?"},
}
resp = smsService.send(data)