Skip to main content
POST
/
api
/
v1
/
functions
/
{function_id}
/
invoke
Invoke
package main

import(
	"context"
	"github.com/conductorone/conductorone-sdk-go/pkg/models/shared"
	conductoronesdkgo "github.com/conductorone/conductorone-sdk-go"
	"github.com/conductorone/conductorone-sdk-go/pkg/models/operations"
	"log"
)

func main() {
    ctx := context.Background()

    s := conductoronesdkgo.New(
        conductoronesdkgo.WithSecurity(shared.Security{
            BearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
            Oauth: "<YOUR_OAUTH_HERE>",
        }),
    )

    res, err := s.Functions.Invoke(ctx, operations.C1APIFunctionsV1FunctionsServiceInvokeRequest{
        FunctionID: "<id>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.FunctionsServiceInvokeResponse != nil {
        // handle response
    }
}
{
  "invocationId": "<string>",
  "json": "aSDinaTvuI8gbWludGxpZnk="
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Authorization
string
header
required

This API uses OAuth2 with the Client Credential flow. Client Credentials must be sent in the BODY, not the headers. For an example of how to implement this, refer to the c1TokenSource.Token() function.

Path Parameters

function_id
string
required

The functionId field.

Body

application/json

The FunctionsServiceInvokeRequest message.

This message contains a oneof named arg. Only a single field of the following list may be set at a time:

  • json
commitId
string

The commitId field.

json
file | null

The json field. This field is part of the arg oneof. See the documentation for c1.api.functions.v1.FunctionsServiceInvokeRequest for more details.

Response

200 - application/json

Successful response

The FunctionsServiceInvokeResponse message.

This message contains a oneof named resp. Only a single field of the following list may be set at a time:

  • json
invocationId
string

The invocationId field.

json
file | null
deprecated

The json field. This field is part of the resp oneof. See the documentation for c1.api.functions.v1.FunctionsServiceInvokeResponse for more details.