Jason Huo
Jason Huo

Reputation: 1

Why upwork authentication api always response failed?

I am building an application with Upwork api.

Now I do the first thing to get a grant code to exchange access token.

The api documentation says:

======

Endpoint GET /ab/account-security/oauth2/authorize ‍ Parameters:

  1. response_type

required, string ‍ The corresponding grant type. Use code for Authorization Code Grant.

  1. client_id

required, string ‍ Your Client ID.

  1. redirect_uri

required, string

‍Redirect URI, must be equal or similar to the callback specified in the key settings.

======

I use this url to get the code but always response failed

https://api.upwork.com/graphql/ab/account-security/oauth2/authorize?response_type=code&client_id=[ClientID]&redirect_uri=[Encoded Callback URL]

the response is:

{ "1": { "str": "Authentication failed" } }

I tried using the redirect URL with encoding and without encoding, still get failed.

Can anyone help me?

Thanks.

Upvotes: 0

Views: 149

Answers (1)

Lan Nguyen
Lan Nguyen

Reputation: 465

you need to build the first url to redirect user (for the user's authentication)

https://upwork.com/ab/account-security/oauth2/authorize?response_type=code&client_id=<client id>&redirect_uri=<url>

Upvotes: 0

Related Questions