Skip to content

Commit 1fa1048

Browse files
add response type for get installation api
1 parent a7251fd commit 1fa1048

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

guides/build-plane-app.mdx

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ response = POST(
8989
)
9090

9191
bot_token = response.data['access_token']
92+
expires_in = response.data["expires_in"]
9293
```
9394

9495
### User-Authorized Actions (Authorization Code Flow)
@@ -113,10 +114,9 @@ response = POST(
113114
data=payload
114115
)
115116

116-
if response.success:
117-
access_token = response.data["access_token"]
118-
refresh_token = response.data["refresh_token"]
119-
117+
access_token = response.data["access_token"]
118+
refresh_token = response.data["refresh_token"]
119+
expires_in = response.data["expires_in"]
120120

121121
# When access token expires, use refresh token to get a new access token
122122
refresh_payload = {
@@ -132,8 +132,7 @@ refresh_response = POST(
132132
data=refresh_payload
133133
)
134134

135-
if refresh_response.success:
136-
access_token = refresh_response.data["access_token"]
135+
access_token = refresh_response.data["access_token"]
137136
```
138137

139138
### Fetching App Installation Details
@@ -154,7 +153,31 @@ response = GET(
154153
headers=headers
155154
)
156155

157-
workspace_details = response.data
156+
workspace_details = response.data[0]
157+
```
158+
159+
#### Sample Response
160+
```
161+
[
162+
{
163+
"id": "34b97361-8636-43dc-953e-90deedc8498f",
164+
"workspace_detail": {
165+
"name": "sandbox",
166+
"slug": "sandbox",
167+
"id": "7a2e5944-c117-4a7d-b5f4-058fe705d7d1",
168+
"logo_url": null
169+
},
170+
"created_at": "2025-05-16T13:50:27.865821Z",
171+
"updated_at": "2025-06-23T08:57:26.976742Z",
172+
"deleted_at": null,
173+
"status": "installed",
174+
"workspace": "7a2e5944-c117-4a7d-b5f4-058fe705d7d1",
175+
"application": "ab235529-388a-4f51-a55a-78272251f5f1",
176+
"installed_by": "63333ab1-c605-42fc-82f7-5cd86799eca1",
177+
"app_bot": "7286aaa7-9250-4851-a520-29c904fd7654", // app's bot user id in the workspace
178+
"webhook": "b1f4b7f1-51e8-4919-a84c-0b1143b51d2c"
179+
}
180+
]
158181
```
159182

160183
## Using Plane SDKs

0 commit comments

Comments
 (0)