Get Script Bindings
Fetch script bindings from a script uploaded to a Workers for Platforms namespace.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYYAPI Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
X-Auth-Email: user@example.comThe previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194Accepted Permissions (at least one required)
Workers Tail ReadWorkers Scripts WriteWorkers Scripts ReadParametersExpand Collapse
ReturnsExpand Collapse
type DispatchNamespaceScriptBindingGetResponse interface{…}A binding to allow the Worker to communicate with resources.
A binding to allow the Worker to communicate with resources.
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindAISearch struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindAISearchNamespace struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindD1 struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindDispatchNamespace struct{…}
The kind of resource that the binding provides.
Outbound DispatchNamespaceScriptBindingGetResponseWorkersBindingKindDispatchNamespaceOutboundOptionalOutbound worker.
Outbound worker.
Params []DispatchNamespaceScriptBindingGetResponseWorkersBindingKindDispatchNamespaceOutboundParamOptionalPass information from the Dispatch Worker to the Outbound Worker through the parameters.
Pass information from the Dispatch Worker to the Outbound Worker through the parameters.
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindDurableObjectNamespace struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindInherit struct{…}
The kind of resource that the binding provides.
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindRatelimit struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindR2Bucket struct{…}
The kind of resource that the binding provides.
Jurisdiction DispatchNamespaceScriptBindingGetResponseWorkersBindingKindR2BucketJurisdictionOptionalThe jurisdiction of the R2 bucket.
The jurisdiction of the R2 bucket.
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindSendEmail struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindService struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindSecretKey struct{…}
Algorithm-specific key parameters. Learn more.
Format DispatchNamespaceScriptBindingGetResponseWorkersBindingKindSecretKeyFormatData format of the key. Learn more.
Data format of the key. Learn more.
The kind of resource that the binding provides.
Usages []DispatchNamespaceScriptBindingGetResponseWorkersBindingKindSecretKeyUsageAllowed operations with the key. Learn more.
Allowed operations with the key. Learn more.
Key data in JSON Web Key format. Required if format is “jwk”.
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindWorkflow struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindWasmModule struct{…}
type DispatchNamespaceScriptBindingGetResponseWorkersBindingKindVPCNetwork struct{…}
Get Script Bindings
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/option"
"github.com/cloudflare/cloudflare-go/workers_for_platforms"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
page, err := client.WorkersForPlatforms.Dispatch.Namespaces.Scripts.Bindings.Get(
context.TODO(),
"my-dispatch-namespace",
"this-is_my_script-01",
workers_for_platforms.DispatchNamespaceScriptBindingGetParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"name": "MY_ENV_VAR",
"text": "my_data",
"type": "plain_text"
}
],
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": [
{
"name": "MY_ENV_VAR",
"text": "my_data",
"type": "plain_text"
}
],
"success": true
}