Skip to content

Commit 25eb343

Browse files
sybohyclaude
andcommitted
feat: multi-language tabs for the Granting Access lead example
Per review: expand the opening JavaScript-only access_grants.create snippet into the full tab set (JavaScript, cURL, Python, Ruby, PHP, Seam CLI, C#), with syntax matching the generated API reference samples. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 59c955d commit 25eb343

1 file changed

Lines changed: 94 additions & 1 deletion

File tree

  • docs/guides/use-cases/granting-access

docs/guides/use-cases/granting-access/README.md

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,111 @@ Use **Access Grants** to grant a person access to a physical space. Access Grant
1010

1111
With one API call, you tell Seam *who* should have access, *where*, *when*, and *how*. Seam creates the credential, attaches it to a user identity, encodes the time window, propagates it to every relevant device, and re-materializes it as devices come online, get added to spaces, or change ownership. PIN codes, mobile keys, and plastic cards—all through the same request.
1212

13+
{% tabs %}
14+
{% tab title="JavaScript" %}
15+
1316
```javascript
1417
await seam.accessGrants.create({
1518
user_identity: {
1619
full_name: "Jane Doe",
1720
email_address: "jane@example.com",
1821
},
19-
device_ids: [front_door_lock_id],
22+
device_ids: ["6ba7b811-9dad-11d1-80b4-00c04fd430c8"],
2023
requested_access_methods: [{ mode: "code" }],
2124
starts_at: "2025-07-13T15:00:00.000Z",
2225
ends_at: "2025-07-16T11:00:00.000Z",
2326
});
2427
```
28+
{% endtab %}
29+
30+
{% tab title="cURL" %}
31+
32+
```bash
33+
curl --include --request POST "https://connect.getseam.com/access_grants/create" \
34+
--header "Authorization: Bearer $SEAM_API_KEY" \
35+
--json @- <<EOF
36+
{
37+
"user_identity": {
38+
"full_name": "Jane Doe",
39+
"email_address": "jane@example.com"
40+
},
41+
"device_ids": ["6ba7b811-9dad-11d1-80b4-00c04fd430c8"],
42+
"requested_access_methods": [
43+
{
44+
"mode": "code"
45+
}
46+
],
47+
"starts_at": "2025-07-13T15:00:00.000Z",
48+
"ends_at": "2025-07-16T11:00:00.000Z"
49+
}
50+
EOF
51+
```
52+
{% endtab %}
53+
54+
{% tab title="Python" %}
55+
56+
```python
57+
seam.access_grants.create(
58+
user_identity={
59+
"full_name": "Jane Doe",
60+
"email_address": "jane@example.com",
61+
},
62+
device_ids=["6ba7b811-9dad-11d1-80b4-00c04fd430c8"],
63+
requested_access_methods=[{"mode": "code"}],
64+
starts_at="2025-07-13T15:00:00.000Z",
65+
ends_at="2025-07-16T11:00:00.000Z",
66+
)
67+
```
68+
{% endtab %}
69+
70+
{% tab title="Ruby" %}
71+
72+
```ruby
73+
seam.access_grants.create(
74+
user_identity: {
75+
full_name: "Jane Doe",
76+
email_address: "jane@example.com",
77+
},
78+
device_ids: %w[6ba7b811-9dad-11d1-80b4-00c04fd430c8],
79+
requested_access_methods: [{ mode: "code" }],
80+
starts_at: "2025-07-13T15:00:00.000Z",
81+
ends_at: "2025-07-16T11:00:00.000Z",
82+
)
83+
```
84+
{% endtab %}
85+
86+
{% tab title="PHP" %}
87+
88+
```php
89+
$seam->access_grants->create(
90+
user_identity: [
91+
"full_name" => "Jane Doe",
92+
"email_address" => "jane@example.com",
93+
],
94+
device_ids: ["6ba7b811-9dad-11d1-80b4-00c04fd430c8"],
95+
requested_access_methods: [
96+
["mode" => "code"],
97+
],
98+
starts_at: "2025-07-13T15:00:00.000Z",
99+
ends_at: "2025-07-16T11:00:00.000Z",
100+
);
101+
```
102+
{% endtab %}
103+
104+
{% tab title="Seam CLI" %}
105+
106+
```bash
107+
seam access-grants create --user_identity {"full_name":"Jane Doe","email_address":"jane@example.com"} --device_ids ["6ba7b811-9dad-11d1-80b4-00c04fd430c8"] --requested_access_methods [{"mode":"code"}] --starts_at "2025-07-13T15:00:00.000Z" --ends_at "2025-07-16T11:00:00.000Z"
108+
```
109+
{% endtab %}
110+
111+
{% tab title="C#" %}
112+
113+
```csharp
114+
// Coming Soon!
115+
```
116+
{% endtab %}
117+
{% endtabs %}
25118

26119
Access Grants work across the entire Seam provider lineup:
27120

0 commit comments

Comments
 (0)