Skip to content
API Reference

Retrieve

client.Zones.Secrets.Get(ctx, id, params) (*ZoneSecretGetResponse, error)
GET/zones/{zone_id}/secrets/{id}
ParametersExpand Collapse
id string
params ZoneSecretGetParams
ZoneID param.Field[string]

Path param: A globally unique opaque identifier

minLength1
XClientRequestID param.Field[string]optional

Header param: Unique request identifier specified by the originating caller and passed along by proxies.

formatuuid
ReturnsExpand Collapse
type ZoneSecretGetResponse struct{…}
ID string

A globally unique opaque identifier

minLength1
CreatedAt Time
formatdate-time
Data ZoneSecretGetResponseDataUnion
Accepts one of the following:
type SecretTokenFields struct{…}
Token string
Type SecretTokenFieldsType
type SecretPasswordFields struct{…}
Password string
Type SecretPasswordFieldsType
Username string
EntityID string

A globally unique opaque identifier

minLength1
Name string

A name for the entity to be displayed in UI

UpdatedAt Time
formatdate-time
Version int64
minimum1
ZoneID string

A globally unique opaque identifier

minLength1
Description stringoptional

A description of the entity

maxLength128
Metadata anyoptional

A JSON object containing arbitrary metadata. Metadata will not be encrypted.

Retrieve

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  secret, err := client.Zones.Secrets.Get(
    context.TODO(),
    "id",
    keycard.ZoneSecretGetParams{
      ZoneID: "x",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", secret.ID)
}
{
  "id": "x",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data": {
    "token": "token",
    "type": "token"
  },
  "entity_id": "x",
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "version": 1,
  "zone_id": "x",
  "description": "description",
  "metadata": {}
}
Returns Examples
{
  "id": "x",
  "created_at": "2019-12-27T18:11:19.117Z",
  "data": {
    "token": "token",
    "type": "token"
  },
  "entity_id": "x",
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "version": 1,
  "zone_id": "x",
  "description": "description",
  "metadata": {}
}