Unauthorized response

When i use the api I get this… ERROR: Unauthorized API request

I was getting this with an account I setup 2 months and then I setup a new account and I am still getting this. I would like to evaluate the service but I can not do it at this pint because my api access is blocked for some reason.

Hi,


Thank you for the request. Does you use the Client ID and Private Key from the new account? Could you please share with us your user email that we can check the logs.

Thank you.

I am also getting an unauthorized response, but with a fairly new account that is still active in trial mode. The unauthorized responses are coming from the DocView API endpoint using calls to ViewDocument, for example. The account is under tony dot morrow at fpx dot com.

Hi Tony,


I’m sorry to hear that you steel have this issue. Could you please share with me an example of your code and the file GUID that you use that I can check it on my side.

Thank you

Hi Pavel,


Thanks for taking a look - the filke GUID I’m testing is just the default “Getting Started” PDF in my root directory: daf39624c53e6cfdb4c27f051356869446903bfc7d76dcb4e8ff8a1127d55d1c.

The code is fairly simple right now - I’m using the Python SDK:
file_guid = kwargs[‘file_guid’] # daf39624c53e6cfdb4c27f051356869446903bfc7d76dcb4e8ff8a1127d55d1c
user_id = "xxxxx"
signer = GroupDocsRequestSigner.GroupDocsRequestSigner(
‘xxxxxsecretkey’)
client = ApiClient.ApiClient(signer)
doc_viewer = DocApi.DocApi(client)
doc_view = doc_viewer.ViewDocument(user_id, file_guid)
return doc_view.result


Hi,


Thank you for the code example. To simply view the document you don’t need to call DocApi, just use such URL for the iframe apps GroupDocs {file GUID} . Also you can check this live demo sample for more info. In the documentation for this sample you will find a Python source code of it which shows how to upload the document and view it.

Best regards.


Hi Pavel,


Thank you, that method does work as you described. Does GroupDocs mainly provide public, permanent embed links based on the file GUID, rather than expiring ones or session-based ones that require the api key? Thanks!

Hi,


I’m glad to hear that the issue is resolved. As for the embed links - yes GroupDocs provides permanent embed links based on the file GUID, if you need to set expiration for it you can develop such functional by your self - simply set and check the session via JavaScript and remove or hide the embeded link if it expired.

Best regards.