Skip to content
Start here

Get share resource by ID

client.ResourceSharing.Resources.Get(ctx, shareID, shareResourceID, query) (*ResourceGetResponse, error)
GET/accounts/{account_id}/shares/{share_id}/resources/{share_resource_id}

Get share resource by ID.

Security

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
shareID string

Share identifier tag.

maxLength32
shareResourceID string

Share Resource identifier.

maxLength32
query ResourceGetParams
AccountID param.Field[string]

Account identifier.

maxLength32
ReturnsExpand Collapse
type ResourceGetResponse struct{…}
ID string

Share Resource identifier.

maxLength32
Created Time

When the share was created.

formatdate-time
Meta unknown

Resource Metadata.

Modified Time

When the share was modified.

formatdate-time
ResourceAccountID string

Account identifier.

maxLength32
ResourceID string

Share Resource identifier.

maxLength32
ResourceType ResourceGetResponseResourceType

Resource Type.

One of the following:
const ResourceGetResponseResourceTypeCustomRuleset ResourceGetResponseResourceType = "custom-ruleset"
const ResourceGetResponseResourceTypeGatewayPolicy ResourceGetResponseResourceType = "gateway-policy"
const ResourceGetResponseResourceTypeGatewayDestinationIP ResourceGetResponseResourceType = "gateway-destination-ip"
const ResourceGetResponseResourceTypeGatewayBlockPageSettings ResourceGetResponseResourceType = "gateway-block-page-settings"
const ResourceGetResponseResourceTypeGatewayExtendedEmailMatching ResourceGetResponseResourceType = "gateway-extended-email-matching"
const ResourceGetResponseResourceTypeIdPFederationGrant ResourceGetResponseResourceType = "idp-federation-grant"
ResourceVersion int64

Resource Version.

Status ResourceGetResponseStatus

Resource Status.

One of the following:
const ResourceGetResponseStatusActive ResourceGetResponseStatus = "active"
const ResourceGetResponseStatusDeleting ResourceGetResponseStatus = "deleting"
const ResourceGetResponseStatusDeleted ResourceGetResponseStatus = "deleted"

Get share resource by ID

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/option"
  "github.com/stainless-sdks/cloudflare-go/resource_sharing"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIKey("144c9defac04969c7bfad8efaa8ea194"),
    option.WithAPIEmail("user@example.com"),
  )
  resource, err := client.ResourceSharing.Resources.Get(
    context.TODO(),
    "3fd85f74b32742f1bff64a85009dda07",
    "023e105f4ecef8ad9ca31a8372d0c353",
    resource_sharing.ResourceGetParams{
      AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", resource.ID)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "created": "2023-09-21T18:56:32.624632Z",
    "meta": {},
    "modified": "2023-09-21T18:56:32.624632Z",
    "resource_account_id": "023e105f4ecef8ad9ca31a8372d0c353",
    "resource_id": "023e105f4ecef8ad9ca31a8372d0c353",
    "resource_type": "custom-ruleset",
    "resource_version": 0,
    "status": "active"
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "created": "2023-09-21T18:56:32.624632Z",
    "meta": {},
    "modified": "2023-09-21T18:56:32.624632Z",
    "resource_account_id": "023e105f4ecef8ad9ca31a8372d0c353",
    "resource_id": "023e105f4ecef8ad9ca31a8372d0c353",
    "resource_type": "custom-ruleset",
    "resource_version": 0,
    "status": "active"
  }
}