You use Nexmo Verify to verify that a user has access to a specific phone number. Nexmo sends a PIN code in an SMS or Text-To-Speech, your user enters this PIN into your App, you validate the PIN with Nexmo. With Verify SDK for Go you easily integrate Verify functionality into your App.
This implementation mimics the Nexmo Android SDK, since Golang is not a supported language.
import nexmo "github.com/hashlabs/nexmo-verify-go-sdk"
client := nexmo.NewClient(<appId>, <sharedSecret>)
response, err := client.VerifySearch(map[string]string {
"device_id": deviceId,
"source_ip_address": "127.0.0.1",
"number": "+521111111111",
})
if err != nil {
panic(err)
}
// Use the response struct to check for the user_status
import nexmo "github.com/hashlabs/nexmo-verify-go-sdk"
client := nexmo.NewClientV2(<apiKey>, <apiSecret>)
response, err := client.VerifyRequest(map[string]string {
"number": "+911111111111",
"brand": "FooBarCompany",
})
if err != nil {
panic(err)
}
// Use the response struct to check for the user_status
import nexmo "github.com/hashlabs/nexmo-verify-go-sdk"
client := nexmo.NewClientV2(<apiKey>, <apiSecret>)
response, err := client.VerifyRequest(map[string]string {
"request_id": "fromTheVerifyRequestResponseValues",
"code": "sms_code",
})
if err != nil {
panic(err)
}
// Use the response struct to check for the user_status
- GetToken
- Verify
- VerifyCheck
- VerifyControl
- VerifySearch
- VerifyLogout
MIT