API documentation for Apple + Google NFC wallet credentials - AccessGrid

API Documentation

Everything you need to interact with AccessGrid.

Terminal

Supported Languages

List Landing Pages

Enterprise only

Request

# Build the JSON payload
PAYLOAD="{}"

# Sign the payload
PAYLOAD_B64=$(printf '%s' "$PAYLOAD" | openssl base64 -A)
SIG=$(printf '%s' "$PAYLOAD_B64" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $NF}')

# Send curl request
curl -G \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
--data-urlencode "sig_payload=$PAYLOAD" \
"https://api.accessgrid.com/v1/console/landing-pages"
require 'accessgrid'

acct_id = ENV['ACCOUNT_ID']
secret_key = ENV['SECRET_KEY']

client = AccessGrid.new(acct_id, secret_key)

landing_pages = client.console.list_landing_pages

landing_pages.each do |page|
  puts "ID: #{page.id}, Name: #{page.name}, Kind: #{page.kind}"
  puts "  Password Protected: #{page.password_protected}"
  puts "  Logo URL: #{page.logo_url}" if page.logo_url
end
import AccessGrid from 'accessgrid';

const accountId = process.env.ACCOUNT_ID;
const secretKey = process.env.SECRET_KEY;

const client = new AccessGrid(accountId, secretKey);

const listLandingPages = async () => {
  try {
      const landingPages = await client.console.listLandingPages();

landingPages.forEach(page => {
        console.log(`ID: ${page.id}, Name: ${page.name}, Kind: ${page.kind}`);
        console.log(`  Password Protected: ${page.passwordProtected}`);
        if (page.logoUrl) console.log(`  Logo URL: ${page.logoUrl}`);
      });
  } catch (error) {
      console.error('Error listing landing pages:', error);
  }
};

listLandingPages();

Response

[
    {
        "id": "a1b2c3d4e5f",
        "name": "Miami Office Access Pass",
        "created_at": "2025-01-15T12:00:00Z",
        "kind": "universal",
        "password_protected": false,
        "logo_url": null
    },
    {
        "id": "f6e5d4c3b2a",
        "name": "NYC Office Badge",
        "created_at": "2025-02-20T08:30:00Z",
        "kind": "personalized",
        "password_protected": true,
        "logo_url": "https://accessgrid.com/path/to/logo.png"
    }
]

Create Landing Page

Enterprise only

Request

# Base64 encode the logo
LOGO=$(openssl base64 -A < /path/to/logo.png)

# Build the JSON payload
PAYLOAD=$(cat <<EOF
{
"name": "Miami Office Access Pass",
"kind": "universal",
"additional_text": "Welcome to the Miami Office",
"bg_color": "#f1f5f9",
"allow_immediate_download": true,
"logo": "$LOGO"
}
EOF
)

# Send curl request
curl -X POST \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/console/landing-pages"

Response

{
    "id": "a1b2c3d4e5f",
    "name": "Miami Office Access Pass",
    "created_at": "2025-01-15T12:00:00Z",
    "kind": "universal",
    "password_protected": false,
    "logo_url": "https://accessgrid.com/path/to/logo.png"
}

Update Landing Page

Enterprise only

Request

# Base64 encode the logo
LOGO=$(openssl base64 -A < /path/to/logo.png)

# Build the JSON payload
PAYLOAD=$(cat <<EOF
{
"name": "Updated Miami Office Access Pass",
"additional_text": "Welcome! Tap below to get your access pass.",
"bg_color": "#e2e8f0",
"logo": "$LOGO"
}
EOF
)

# Send curl request
curl -X PUT \
-H "X-ACCT-ID: $ACCOUNT_ID" \
-H "X-PAYLOAD-SIG: $SIG" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"https://api.accessgrid.com/v1/console/landing-pages/{landing_page_id}"

Response