Skip to content

Latest commit

 

History

History
81 lines (52 loc) · 2.85 KB

AuthenticationAPI.md

File metadata and controls

81 lines (52 loc) · 2.85 KB

\AuthenticationAPI

All URIs are relative to https://products.api.telstra.com/messaging/v3

Method HTTP request Description
AuthToken Post /oauth/token Generate an access token

AuthToken

OAuth AuthToken(ctx).ClientId(clientId).ClientSecret(clientSecret).GrantType(grantType).Scope(scope).Execute()

Generate an access token

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID"
)

func main() {
    clientId := "clientId_example" // string | Copy and paste your `client_id` here. Find it in your [dashboard](https://dev.telstra.com).
    clientSecret := "clientSecret_example" // string | Copy and paste your `client_secret` here. Find it in your [dashboard](https://dev.telstra.com).
    grantType := "grantType_example" // string | Ensure the `grant_type` is **client_credentials**. (default to "client_credentials")
    scope := "scope_example" // string | Ensure the `scope` is **verification:read**. (optional) (default to "verification:read")

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.AuthenticationAPI.AuthToken(context.Background()).ClientId(clientId).ClientSecret(clientSecret).GrantType(grantType).Scope(scope).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthToken``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `AuthToken`: OAuth
    fmt.Fprintf(os.Stdout, "Response from `AuthenticationAPI.AuthToken`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAuthTokenRequest struct via the builder pattern

Name Type Description Notes
clientId string Copy and paste your `client_id` here. Find it in your dashboard.
clientSecret string Copy and paste your `client_secret` here. Find it in your dashboard.
grantType string Ensure the `grant_type` is client_credentials. [default to "client_credentials"]
scope string Ensure the `scope` is verification:read. [default to "verification:read"]

Return type

OAuth

Authorization

bearer_auth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]