AccessIntents

The AccessIntent object

Attributes


id - string

Unique identifier for the object.


**description** - string

Piece of text that shows up in the access flow user interface.


profile_name - string

Short text that you can identify your company or community with.


status - string

Status of the AccessIntent, one of requires_wallet, requires_signing, succeeded, canceled, expired. Check for the succeeded status to continue any logic in your own application to grant the user access to your community or service.


return_url - string

The URL that Clubcard will redirect the user to upon completing the access flow on successful verification of wallet and owned NFTs.


access_list - array with objects

The list of NFT contract addresses and optionally specific tokens per contract address that can be granted access with this AccessIntent. An empty array means that any wallet is allowed.


created_at - datetime

When the AccessIntent was created.


**updated_at** - datetime

When the AccessIntent was last updated.


Sample


{
  "id": "ai_Nws31t7Z6Ztqa8KfGAYMxBFy",
  "description": "Only access for VaaFriends",
  "profile_name": "Geery VeenerCheck",
  "status": "requires_wallet",
  "return_url": "<https://opensea.io/collection/veefriends>",
  "access_list": [
    {
      "contract_address": "0xa3aee8bce55beea1951ef834b99f3ac60d1abeeb",
      "token_ids": [
        "9180",
        "9182",
        "9183"
      ]
    }
  ],
  "created_at": "2021-12-23T21:23:03.259Z",
  "updated_at": "2021-12-23T21:23:03.259Z",
  "redirect_url": "<https://app.clubcard.dev/a/Nws31t7Z6Ztqa8KfGAYMxBFy>"
}

Create an AccessIntent

Also see the guide: Guide: Accept a sign in with a wallet or NFT

Parameters


**description** - required

Piece of text that shows up in the access flow user interface. Use it to describe what kind of access someone will get. Access to your community? Signing up for an account? Becoming a member of your brand?


**profile_name** - required

Short text that you can identify your company or community with. Will be shown as a big heading in the access flow user interface.


**return_url** - required

The URL back to your application that Clubcard will redirect the user to upon completing the access flow on successful verification of wallet and owned NFTs.


**access_list** - optional

The list of NFT contract addresses and optionally specific tokens per contract address that can be granted access with this AccessIntent. An empty array means that any wallet is allowed.

Returns


An AccessIntent.

Sample


curl <https://app.clubcard.dev/api/v1/access_intents> \\
  -H 'Content-Type: application/json' \\
  -d '{"description": "Access to RareBlocks Bonus",
      "profile_name": "Clubcard",
      "return_url": "<https://rareblocks.xyz>",
      "access_list": [
        {
          "contract_address": "0x1bb191e56206e11b14117711C333CC18b9861262",
          "token_ids": ["100", "105"]
        }
      ]}'

Fetch an AccessIntent

Arguments


None.

Returns


An AccessIntent.

Sample


curl <https://app.clubcard.dev/api/v1/access_intents/ai_wiE5k5hUku54Unx6z7srD8HW>

AccessIntent Webhook events

Clubcard will send a HTTP POST JSON payload to the webhook_url set when creating the AccessIntent.

Events


**access_intent.connected** - someone just connected their wallet in the access flow


**access_intent.succeeded** - someone just signed and confirmed their wallet and Clubcard verified if all NFTs and tokens in the provided access_list are owned by the wallet.


**access_intent.canceled** - the access flow was canceled. either by the user or by you programatically (not yet implemented)


**access_intent.expired** - the access intent was not used within 30 minutes of creation and has now been made unavailable

Sample event payload


{
  "type": "access_intent.succeeded",
  "data": {
    "customer_id": null,
    "nft_address": null,
    "created_at": "2021-12-24T23:52:09.004Z",
    "updated_at": "2021-12-24T23:52:19.344Z",
    "wallet_address": "0xf40fa9f902368954b93bd12337D5E89995108b8A",
    "reference": null,
    "access_list": [
      {
        "contract_address": "0x1bb191e56206e11b14117711C333CC18b9861262"
      }
    ],
    "nonce": "LncTH58YYadku8e6KHDz5zWH",
    "description": "Access to RareBlocks Bonus",
    "profile_name": "Rareblocks Bonus",
    "return_url": "<https://rareblocks.xyz>",
    "status": "succeeded",
    "webhook_url": "<https://hookb.in/eKNGzg6z7aflwQmmwpBy>",
    "object": "access_intent",
    "id": "ai_yruhP34fVPPGA31FLxvEEzof"
  },
  "created_at": "2021-12-24T23:52:47.076Z",
  "updated_at": "2021-12-24T23:52:47.076Z",
  "object": "event"
}