Skip to content

Latest commit

 

History

History
72 lines (54 loc) · 4.82 KB

README.md

File metadata and controls

72 lines (54 loc) · 4.82 KB

CreateCallback

(Vault.CreateCallback)

Overview

Available Operations

  • State - Create Callback State

State

This endpoint creates a callback state that can be used to issue requests to the callback endpoint.

Example Usage

package main

import(
	"context"
	"os"
	sdkgo "github.com/apideck-libraries/sdk-go"
	"github.com/apideck-libraries/sdk-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := sdkgo.New(
        sdkgo.WithSecurity(os.Getenv("APIDECK_API_KEY")),
        sdkgo.WithConsumerID("test-consumer"),
        sdkgo.WithAppID("dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"),
    )

    res, err := s.Vault.CreateCallback.State(ctx, "pipedrive", "crm", components.CreateCallbackState{
        RedirectURI: sdkgo.String("https://example.com/callback"),
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.CreateCallbackStateResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description Example
ctx context.Context ✔️ The context to use for the request.
serviceID string ✔️ Service ID of the resource to return pipedrive
unifiedAPI string ✔️ Unified API crm
createCallbackState components.CreateCallbackState ✔️ Callback state data
opts []operations.Option The options for this request.

Response

*operations.VaultCreateCallbackStateResponse, error

Errors

Error Type Status Code Content Type
apierrors.BadRequestResponse 400 application/json
apierrors.UnauthorizedResponse 401 application/json
apierrors.PaymentRequiredResponse 402 application/json
apierrors.NotFoundResponse 404 application/json
apierrors.UnprocessableResponse 422 application/json
apierrors.APIError 4XX, 5XX */*