sdk

package module
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

Voximplant API client library

Version 1.13.0

Prerequisites

In order to use Voximplant SDK for the Go programming language, you need the following:

  1. A developer account. If you don't have one, sign up here.
  2. A private API key. There are 2 options to obtain it:
    1. Either generate it in the Voximplant Control panel
    2. Or call the CreateKey HTTP API method with the specified authentication parameters. You'll receive a response with the result field in it. Save the result value in a file (since we don't store the keys, save it securely on your side).

Getting started

  • The best way to start is to use go get to add the SDK to your Go Workspace or application using Go modules:

    go get github.com/voximplant/apiclient-go
    
  • Without Go Modules (or in a GOPATH with Go 1.11 or 1.12), use go get with the /... suffix to retrieve all of the SDK's dependencies:

    go get github.com/voximplant/apiclient-go/...
    
Example

This example shows how you can use the API client.

package main

import (
	"fmt"
	"github.com/voximplant/apiclient-go/config"
	"github.com/voximplant/apiclient-go/methods"
)

func main() {
	voxConfig := config.NewConfig().WithEndpoint("https://api.voximplant.com/platform_api/").WithKeyPath("vox_key_jwt.json")
	// Create a Voximplant client using the Config value
	client, err := methods.NewClient(voxConfig)
	if err != nil {
		panic("failed to create client, " + err.Error())
	}
	// Build input parameters
	params := methods.GetSubscriptionPriceParams{SubscriptionTemplateType: "SIP_REGISTRATION"}
	// Send the request and get the response or error back
	res, verr, err := client.Accounts.GetSubscriptionPrice(params)

	fmt.Println(res, verr, err)
}

Documentation

Overview

Prerequisites

In order to use Voximplant SDK for the Go programming language, you need the following:

A developer account. If you don't have one, sign up here. A private API key. There are 2 options to obtain it: Either generate it in the Voximplant Control panel Or call the CreateKey HTTP API method with the specified authentication parameters. You'll receive a response with the result field in it. Save the result value in a file (since we don't store the keys, save it securely on your side).

Getting started

The best way to start is to use go get to add the SDK to your Go Workspace or application using Go modules:

go get github.com/voximplant/apiclient-go

Without Go Modules (or in a GOPATH with Go 1.11 or 1.12), use go get with the /... suffix to retrieve all of the SDK's dependencies:

go get github.com/voximplant/apiclient-go/...

Example

This example shows how you can use the API client.

package main

import (
	"fmt"
	"github.com/voximplant/apiclient-go/config"
	"github.com/voximplant/apiclient-go/methods"
)

func main() {
	voxConfig := config.NewConfig().WithEndpoint("https://api.voximplant.com/platform_api/").WithKeyPath("vox_key_jwt.json")
	// Create a Voximplant client using the Config value
	client, err := methods.NewClient(voxConfig)
	if err != nil {
		panic("failed to create client, " + err.Error())
	}
	// Build input parameters
	params := methods.GetSubscriptionPriceParams{SubscriptionTemplateType:"SIP_REGISTRATION"}
	// Send the request and get the response or error back
	res, verr, err := client.Accounts.GetSubscriptionPrice(params)

	fmt.Println(res, verr, err)
}

Directories

Path Synopsis
_examples
Accounts command
AdminRoles command
AdminUsers command
Applications command
AuthorizedIPs command
CallerIDs command
Invoices command
Keyvaluestorage command
PSTNBlacklist command
PhoneNumbers command
PushCredentials command
RecordStorages command
RoleSystem command
Rules command
SIPRegistration command
SIPWhiteList command
Skills command
Users command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL