Free Support Forum - groupdocs.cloud

Document Management REST API Solution GroupDocs.Conversion Cloud API request authentication issue

Hello, I have created my first app and stored file in it, now trying to test conversion API, when I attempted to test at https://apireference.groupdocs.cloud/conversion/, I have entered App SID and AppKey provided in the dashboard, but I keep receiving Auth Error Error: Bad Request, error: invalid_client.

Please help me to solve this issue.

@dineshbabu179

Please double check your credentials from GroupDocs Dashboard. Please click on the lock icon to view your App Key. The credentials should be like as follows. Hopefully it will resolve the issue.

//dummy values
APP_SID = “7b854efb-6e7c-678e-b89b-e89d78e13456”
API_KEY = “89fb43e80f2345d022a567888136e041”

@tilal.ahmad, yep I am using the same, but receiving an error.
2020-07-01_11-37-05.jpg (45.6 KB)

what is the CURL request to get the Oauth Token, I can try the same from Postman tool

Thanks
Dinesh

My postman request

POST https://api.groupdocs.cloud/connect/token 400
POST /connect/token HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
User-Agent: PostmanRuntime/7.26.1
Cache-Control: no-cache
Postman-Token: 52765d78-b47e-4473-b70e-a0635f4ba4c0
Host: api.groupdocs.cloud
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 115
grant_type=client_credentials&APP_SID=bbb60f0f-aed6-4dbb-a894-b69315xxxxxx&APP_KEY=c8f98393e6b82eeaed31dfc047xxxxxx
HTTP/1.1 400 Bad Request
Content-Type: application/json; charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 01 Jul 2020 16:00:44 GMT
Cache-Control: no-store, no-cache, max-age=0
Pragma: no-cache
X-Cache: Error from cloudfront
Via: 1.1 c34e5d6ab957cd4e49caca604410ca40.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: ATL56-C1
X-Amz-Cf-Id: FPoHRDRzjUZ4Sia6tt4WKyWkBgnWvCQAVB9hcww0JvwvD-aLocBz5w==
Connection: Keep-Alive
{“error”:“invalid_client”}

@dineshbabu179

The Postman is working fine at my end with my credentials. Please share your credentials in a private message (click on my username in the post and use message tab for private message). We will look into it and will guide you.

Hay, I have to switch to corporate account for further POC. I have solved Auth issue. instead of sending client_id and client_secret, i was sending it AppSID and AppKey.

Now testing storage and conversion function, here is what I have

App Name : First App
Stroage: FirstStorage

2020-07-01_17-56-40.jpg (31.1 KB)

I have authenticated with API successfully, and playing with storage calls but getting a different response

https://api.groupdocs.cloud/v2.0/conversion/storage/FirstStorage/exist
{“exists”:false}

But API version 1.1 is working fine.

https://api.groupdocs.cloud/v1.1/storage/FirstStorage/exist?appsid=207c3f0f-7ad9-49b3-b51a-ef8f28XXXXXX&signature=XXXXXXXXXXXXXXXXXXXXXXX

{
“isExist”: true,
“code”: 200,
“status”: “OK”
}

Could you please help me what I am doing wrong?

@dinesh.velusamy

Please note API Version V2 uses JSON Web Token(JWT) for API request authentication. However, API Version 1.1 uses OAuth 2.0. Hopefully it will help to resolve the issue.

// Get JWT Access Token
// Get App Key(client_secret) and App SID(client_id) from https://dashboard.groupdocs.cloud/
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx-xxxx-xxxx-xxxx-xxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxxxxxxxxx" 
-H "Content-Type: application/x-www-form-urlencoded" 
-H "Accept: application/json"


// Check If storage Exists
curl -X GET "https://api.groupdocs.cloud/v2.0/conversion/storage/First Storage/exist" 
-H "accept: application/json" 
-H "authorization: Bearer [JWT_Access_Token]" 
-H "x-aspose-client: Containerize.Swagger"

I am doing exactly the same from postman as described in the documentation, got the token successfully sending token through HTTP Authorization header.

Note : My storage space name is “FirstStorage” not “First Storage”, I have renamed it

Here is postman log

GET https://api.groupdocs.cloud/v2.0/conversion/storage/FirstStorage/exist 200 384 ms
GET /v2.0/conversion/storage/FirstStorage/exist HTTP/1.1
Accept: application/json
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1OTM2OTUxMTUsImV4cCI6MTU5Mzc4MTUxNSwiaXNzIjoiaHR0cDovL2FwaS5ncm91cGRvY3MuY2xvdWQiLCJhdWQiOlsiaHR0cDovL2FwaS5ncm91cGRvY3MuY2xvdWQvcmVzb3VyY2VzIiwiYXBpLnBsYXRmb3JtIiwiYXBpLnByb2R1Y3RzIiwiYXBpLnN0b3JhZ2UiXSwiY2xpZW50X2lkIjoiMjA3YzNmMGYtN2FkOS00OWIzLWI1MWEtZWY4ZjI4YWQxOGEyIiwiY2xpZW50X2RlZmF1bHRfc3RvcmFnZSI6IjcyQUQ1RDE5LUM1MjMtNDI4MS04RTVGLTA0MTFFMDVCRjIwRiIsImNsaWVudF9pZFNydklkIjoiODMwMDk4Iiwic2NvcGUiOlsiYXBpLnBsYXRmb3JtIiwiYXBpLnByb2R1Y3RzIiwiYXBpLnN0b3JhZ2UiXX0.QqDwAYJdFCdTqNxU2GWm1-2IEcrMf_dxKrwSfaDsWO-Htc1iSIAHkgBVDMSQ8u3dWMq6lZZODQSA2ux6bDmaRtmd1QwR4G4rGTqF8a7BWGchwUevJUpxIlAmXmtJBPpzeJ5cxD6-l55gBObhRT_QApPAsJfPqt4gHeoNT8YFAnHNZnjYUHXCkiPfITbKQBR5Jwtkm17WCuOLd7Q9lWHhuLdTeGCHierSJrr8CsjVOpXXsY78farXWsG3SoUpQ8Kmhw5-YbvGtrEmGApLUeHlbP1BU0GGRUbnpW7rGZfyLSOP5U-FBJdkevb_7v2oJqF0esZ3IEN8l07re4J1R9iN2w
User-Agent: PostmanRuntime/7.26.1
Cache-Control: no-cache
Postman-Token: 674b9b46-adfc-4b9a-be9b-00746b6c4fb1
Host: api.groupdocs.cloud
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 02 Jul 2020 13:05:19 GMT
Server: Kestrel
Strict-Transport-Security: max-age=2592000
X-Cache: Miss from cloudfront
Via: 1.1 68d0308c2ef809661e524bd15564b0bd.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: MIA3-C2
X-Amz-Cf-Id: VuPbehh5v1XTXZP05RObI3tpJvW72ZwlaOObGjY2ovKqkFKV1rJEBg==
Cache-Control: proxy-revalidate
Connection: Keep-Alive
{“exists”:false}

Thanks
Dinesh

@dinesh.velusamy

We are sorry for the inconvenience. We are analyzing the server logs and will share our findings with you soon.

@dinesh.velusamy

We have analyzed the server logs and unable to find any issue, everything is working fine. Can you please double check and confirm?