Skip to content

Commit 39fa58a

Browse files
committed
fix placement of example and response for delete trigger
add example response for update trigger
1 parent ecc2ef1 commit 39fa58a

File tree

1 file changed

+136
-86
lines changed

1 file changed

+136
-86
lines changed

docs-v2/pages/connect/api.mdx

Lines changed: 136 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,93 @@ The deployed trigger ID for the trigger you'd like to retrieve (ex, `dc_xxxxxxx`
27092709
[The external user ID](/connect/api/#external-users) in your system on behalf of
27102710
which you want to deploy the trigger.
27112711

2712+
##### Examples
2713+
2714+
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
2715+
2716+
<Tabs.Tab>
2717+
```typescript
2718+
import {
2719+
createBackendClient,
2720+
type BackendClient,
2721+
type BackendClientOpts,
2722+
type DeleteTriggerOpts,
2723+
} from "@pipedream/sdk/server";
2724+
2725+
const clientOpts: BackendClientOpts = {
2726+
environment: "development", // change to production if running for a test production account, or in production
2727+
credentials: {
2728+
clientId: "{oauth_client_id}",
2729+
clientSecret: "{oauth_client_secret}",
2730+
},
2731+
projectId: "{your_project_id}"
2732+
};
2733+
const pd: BackendClient = createBackendClient(clientOpts);
2734+
2735+
// Delete the deployed trigger for the specified user.
2736+
const requestOpts: DeleteTriggerOpts = {
2737+
id: "dc_gzumK2e",
2738+
externalUserId: "jverce",
2739+
};
2740+
2741+
// The method doesn't return any data.
2742+
await pd.deleteTrigger(requestOpts);
2743+
```
2744+
</Tabs.Tab>
2745+
2746+
<Tabs.Tab>
2747+
```javascript
2748+
import {
2749+
createBackendClient,
2750+
} from "@pipedream/sdk/server";
2751+
2752+
const pd = createBackendClient({
2753+
environment: "development", // change to production if running for a test production account, or in production
2754+
credentials: {
2755+
clientId: "{oauth_client_id}",
2756+
clientSecret: "{oauth_client_secret}",
2757+
},
2758+
projectId: "{your_project_id}"
2759+
});
2760+
2761+
// Delete the deployed trigger for the specified user. The method doesn't return
2762+
// any data.
2763+
await pd.deleteTrigger({
2764+
id: "dc_gzumK2e",
2765+
externalUserId: "jverce"
2766+
});
2767+
```
2768+
</Tabs.Tab>
2769+
2770+
<Tabs.Tab>
2771+
```bash
2772+
# First, obtain an OAuth access token
2773+
curl -X POST https://api.pipedream.com/v1/oauth/token \
2774+
-H "Content-Type: application/json" \
2775+
-d '{
2776+
"grant_type": "client_credentials",
2777+
"client_id": "{oauth_client_id}",
2778+
"client_secret": "{oauth_client_secret}"
2779+
}'
2780+
2781+
# The response will include an access_token. Use it in the Authorization header below.
2782+
# This request will list all deployed triggers for the specified user.
2783+
2784+
curl -X DELETE \
2785+
-G \
2786+
"https://api.pipedream.com/v1/connect/{your_project_id}/deployed-triggers/{deployed_trigger_id}/" \
2787+
-H "Authorization: Bearer {access_token}" \
2788+
-H "Content-Type: application/json" \
2789+
-H "x-pd-environment: development" \
2790+
-d "external_user_id={external_user_id}"
2791+
```
2792+
</Tabs.Tab>
2793+
</Tabs>
2794+
2795+
##### Response
2796+
2797+
Pipedream returns a `204 No Content` response on successful deletion
2798+
27122799
#### Update a deployed trigger
27132800

27142801
Update a deployed trigger for a given user.
@@ -2852,96 +2939,59 @@ curl -X PUT "https://api.pipedream.com/v1/connect/{your_project_id}/deployed-tri
28522939
}'
28532940
```
28542941
</Tabs.Tab>
2855-
28562942
</Tabs>
28572943

2858-
##### Examples
2859-
2860-
<Tabs items={['TypeScript', 'Node.js', 'HTTP (cURL)']}>
2861-
2862-
<Tabs.Tab>
2863-
```typescript
2864-
import {
2865-
createBackendClient,
2866-
type BackendClient,
2867-
type BackendClientOpts,
2868-
type DeleteTriggerOpts,
2869-
} from "@pipedream/sdk/server";
2870-
2871-
const clientOpts: BackendClientOpts = {
2872-
environment: "development", // change to production if running for a test production account, or in production
2873-
credentials: {
2874-
clientId: "{oauth_client_id}",
2875-
clientSecret: "{oauth_client_secret}",
2876-
},
2877-
projectId: "{your_project_id}"
2878-
};
2879-
const pd: BackendClient = createBackendClient(clientOpts);
2880-
2881-
// Delete the deployed trigger for the specified user.
2882-
const requestOpts: DeleteTriggerOpts = {
2883-
id: "dc_gzumK2e",
2884-
externalUserId: "jverce",
2885-
};
2886-
2887-
// The method doesn't return any data.
2888-
await pd.deleteTrigger(requestOpts);
2889-
```
2890-
</Tabs.Tab>
2891-
2892-
<Tabs.Tab>
2893-
```javascript
2894-
import {
2895-
createBackendClient,
2896-
} from "@pipedream/sdk/server";
2897-
2898-
const pd = createBackendClient({
2899-
environment: "development", // change to production if running for a test production account, or in production
2900-
credentials: {
2901-
clientId: "{oauth_client_id}",
2902-
clientSecret: "{oauth_client_secret}",
2903-
},
2904-
projectId: "{your_project_id}"
2905-
});
2906-
2907-
// Delete the deployed trigger for the specified user. The method doesn't return
2908-
// any data.
2909-
await pd.deleteTrigger({
2910-
id: "dc_gzumK2e",
2911-
externalUserId: "jverce"
2912-
});
2913-
```
2914-
</Tabs.Tab>
2915-
2916-
<Tabs.Tab>
2917-
```bash
2918-
# First, obtain an OAuth access token
2919-
curl -X POST https://api.pipedream.com/v1/oauth/token \
2920-
-H "Content-Type: application/json" \
2921-
-d '{
2922-
"grant_type": "client_credentials",
2923-
"client_id": "{oauth_client_id}",
2924-
"client_secret": "{oauth_client_secret}"
2925-
}'
2926-
2927-
# The response will include an access_token. Use it in the Authorization header below.
2928-
# This request will list all deployed triggers for the specified user.
2944+
##### Example response
29292945

2930-
curl -X DELETE \
2931-
-G \
2932-
"https://api.pipedream.com/v1/connect/{your_project_id}/deployed-triggers/{deployed_trigger_id}/" \
2933-
-H "Authorization: Bearer {access_token}" \
2934-
-H "Content-Type: application/json" \
2935-
-H "x-pd-environment: development" \
2936-
-d "external_user_id={external_user_id}"
2946+
```json
2947+
{
2948+
"data": {
2949+
"id": "dc_dAuGmW7",
2950+
"owner_id": "exu_oedidz",
2951+
"component_id": "sc_3vijzQr",
2952+
"configurable_props": [
2953+
{
2954+
"name": "gitlab",
2955+
"type": "app",
2956+
"app": "gitlab"
2957+
},
2958+
{
2959+
"name": "db",
2960+
"type": "$.service.db"
2961+
},
2962+
{
2963+
"name": "http",
2964+
"type": "$.interface.http",
2965+
"customResponse": true
2966+
},
2967+
{
2968+
"name": "projectId",
2969+
"type": "integer",
2970+
"label": "Project ID",
2971+
"description": "The project ID, as displayed in the main project page",
2972+
"remoteOptions": true
2973+
}
2974+
],
2975+
"configured_props": {
2976+
"gitlab": {
2977+
"authProvisionId": "apn_kVh9AoD"
2978+
},
2979+
"db": {
2980+
"type": "$.service.db"
2981+
},
2982+
"http": {
2983+
"endpoint_url": "https://xxxxxxxxxx.m.pipedream.net"
2984+
},
2985+
"projectId": 45672542
2986+
},
2987+
"active": true,
2988+
"created_at": 1734028283,
2989+
"updated_at": 1734038486,
2990+
"name": "My Updated Trigger",
2991+
"name_slug": "my-updated-trigger"
2992+
}
2993+
}
29372994
```
2938-
</Tabs.Tab>
2939-
</Tabs>
2940-
2941-
##### Response
2942-
2943-
Pipedream returns a `204 No Content` response on successful deletion
2944-
29452995

29462996
#### Retrieve the events emitted by a deployed trigger
29472997

0 commit comments

Comments
 (0)