You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-v2/pages/connect/api.mdx
+45-15Lines changed: 45 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,25 @@ or a specific version:
43
43
44
44
## Authentication
45
45
46
+
### OAuth
47
+
48
+
TO DO
49
+
50
+
### Project keys
51
+
52
+
You authenticate to the Connect API using **Basic Auth**. Send your project public key as the username and the project secret key as the password. When you make API requests, pass an
Most of your interactions with the Connect API will happen on the server, to protect API requests and user credentials. You'll use the SDK in [your frontend](#typescript-sdk-browser) to let users connect accounts. Once connected, you'll use the SDK on the server to retrieve credentials, invoke workflows on their behalf, and more.
@@ -102,21 +121,6 @@ export default function Home() {
102
121
}
103
122
```
104
123
105
-
### REST API
106
-
107
-
You authenticate to the Connect API using **Basic Auth**. Send your project public key as the username and the project secret key as the password. When you make API requests, pass an
When you use the Connect API, you'll pass an `external_id` parameter when initiating account connections and retrieving credentials. This is your user's ID, in your system — whatever you use to uniquely identify them.
@@ -136,6 +140,32 @@ If you need higher rate limits, please [reach out](https://pipedream.com/support
136
140
137
141
## API Reference
138
142
143
+
### Invoke workflows
144
+
145
+
You can use the SDK to invoke workflows on behalf of your users. Here's an example of invoking a workflow with the SDK:
146
+
147
+
```typescript
148
+
import { createClient } from"@pipedream/sdk";
149
+
150
+
const pd =createClient({
151
+
oauthClientId: "your-oauth-client-id",
152
+
oauthClientSecret: "your-oauth-client-secret",
153
+
});
154
+
155
+
const response =awaitpd.invokeWorkflow(
156
+
"https://your-workflow-url.m.pipedream.net",
157
+
{
158
+
body: {
159
+
foo: 123,
160
+
bar: "abc",
161
+
},
162
+
// pass any other fetch options here
163
+
},
164
+
);
165
+
```
166
+
167
+
`invokeWorkflow` uses Node's `fetch` API, so you can pass any standard options in that object.
168
+
139
169
### Tokens
140
170
141
171
Your app will initiate the account connection flow for your end users in your frontend. But you can't expose your project keys in the client, since they'd be accessible to anyone. Instead, on your server, **you exchange your project keys for a short-lived token that allows a specific user to connect a specific app**, and return that token to your frontend.
0 commit comments