Test that the API and auth are working.
@zapier/ai-actions
:
custom
integration app.@zapier/ai-actions
API client, your app must
have “Public Client” checked.@zapier/ai-actions
library to handle authentication for you!See the @zapier/ai-actions
documentation hereBearer
token.
To begin this process, you first need to generate a code verifier and a code challenge.
Here is some sample code in TypeScript to do this:
redirect_uri
you provided with a code
query parameter.
You can then exchange this code for a token, using the verifier
that you generated previously:
access_token
can then be used to make API calls to AI Actions:
/oauth/authorize
URL as outlined above.
Then, get the account creation URL for your OAuth client:
login_link
, they will go through a quick Zapier account creation flow. If the provided email address is already associated with a Zapier account, they will be asked to log in.
Users will receive a follow-up email from Zapier to confirm their email address and to let them set a password for the account.
The user will then see the AI Actions OAuth consent screen and be redirected back to your redirect_uri
with a code
query parameter, which can be exchanged for an access token as outlined above.
expires_in
seconds, the access_token
will expire. To get a new token, you can use the refresh_token
that was returned when you got the original token:
Authorization: Bearer ...
header.OK
The response is of type object
.