Here’s a simplified breakdown:
- Understanding the Upwork API Authentication Process
Upwork uses OAuth 2.0 for authentication, which involves:
Getting an authorization code.
Exchanging the authorization code for an access token.
The tricky part is to handle the redirect_url properly in your workflow within Make.
- Basic OAuth 2.0 Flow for Upwork API
Request Authorization Code: You open a URL to get the user’s consent (where you paste the URL into your web browser). Upwork then redirects you to your redirect_url with an authorization code.
Exchange Authorization Code: You exchange that code for an access token using another API request.
Access Token: Once you have the access token, you can use it to access Upwork’s API.
- Setting Up the Webhook in Make (formerly Integromat)
Create a Webhook in Make:
In Make, create a webhook module.
It will give you a unique Webhook URL.
Set Webhook URL as Redirect:
When registering your app on Upwork, use the Webhook URL from Make as your redirect_url.
This way, once you authorize in the browser, Upwork will send the authorization code to the Webhook.
- OAuth Setup for Upwork in Make
Now, let’s break down how you can automate the OAuth 2.0 process in Make.
Step 1: Authorization Code Request In Make, you won’t trigger this automatically as OAuth requires user interaction for login. Open the URL in your browser:
https:/ /www.upwork. com/api/auth/v1/oauth2/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=YOUR_MAKE_WEBHOOK_URL
Replace YOUR_CLIENT_ID with your Upwork app’s client ID.
Replace YOUR_MAKE_WEBHOOK_URL with the Webhook URL created in Make.
After you grant access, Upwork will redirect to the Make Webhook URL with the authorization code.
Step 2: Capture the Authorization Code in Make When Upwork redirects to the Webhook URL, Make will capture the authorization code.
Add a Webhook Trigger module in Make to capture the incoming data from Upwork (this will be the authorization_code).
Step 3: Exchange Authorization Code for Access Token
Add an HTTP module in Make to send a POST request to Upwork to exchange the authorization code for an access token. The endpoint to use is:
https:// www.upwork. com/api/auth/v1/oauth2/token
Use the authorization code from the previous step.
You need to send the client_id, client_secret, grant_type as authorization_code, and the authorization code itself.
Upwork will respond with an access token.
Step 4: Use the Access Token to Get New Jobs Now that you have the access token, you can use it to call the Upwork Jobs API. You can make requests to endpoints like:
https:// www.upwork. com/api/v3/jobs/search.json?q=YOUR_QUERY
Add another HTTP module to Make to make the request.
Include the access token in the header (as a Bearer Token).
Step 5: Send the Job Data to Email After fetching the jobs:
Use an Email module in Make to send yourself an email with the list of new jobs.