OAuth2 UpWork Failing The Next Day

Describe the problem/error/question

We used OAuth2 Authorization Code grant type for UpWork.com for a client.

The UpWork OAuth connection worked fine for the first 24hr. We came back to working on the flow today to see a bizarre error. Nothing has changed since then.

I have tried to do as much research as I can, and saw both on GitHub and in the forums here of similar issues in the past that either were “fixed” or never responded to / resolved (many of these).

My ultimate question:
Is this a misunderstanding of OAuth, my setup, or is this really a bug with n8n? I am fine with manually doing the oauth refresh requests etc but that seems overkill if n8n should handle this already…

What is the error message (if any)?

Toast Error:

Problem in node ‘UpWork Fetch Business Info‘
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.

Stack Trace:

NodeApiError: The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:525:33) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:741:19) at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:724:51 at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1155:20

Please share your workflow


Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.71.3 (Cloud)
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: cloud

Hi @ThinkBot

I think your authentication is fine but looking at the error it’s probably related to what the API expects from your request body.

Doing a quick google search, it seems that it does expect a JSON, so you need to change that in your node config:

Have a look at the official Upwork Docs to see what it’s expecting to receive
(You can see it’s expecting application/json):

                  curl --request POST \
                    --url https://api.upwork.com/graphql \
                    --header 'Authorization: bearer oauth2v2_f5*************************' \
                    --header 'Content-Type: application/json' \
                    --header 'X-Upwork-API-TenantId: 470*************' \
                    --data '{"query":"query { \
                        organization { \
                        id \
                        childOrganizations { \
                        id \
                        name \
                      } \
                    } \
                  }"}'

https://www.upwork.com/developer/documentation/graphql/api/docs/index.html