question

Upvotes
Accepted
8 2 2 2

Filings API - 403 error is returned

filings.zipFiling API question

“# search for the document first” in “fillings.py” (as below) works but error is returned by

"fileName, signedUrl = retrieveDocURL(docId)”


“retrieveSaveDoc(fileName, signedUrl) “ part is the same result.


[Error]


ValueError: Unable to get document URL. Code 403, Message: {"error":{"id":"bfe7676d-2be6-4667-8a82-19ea85b554bd","code":"insufficient_scope","message":"access denied. Scopes required to access the resource: [trapi.data.filings.retrieval]. Missing scopes: [trapi.data.filings.retrieval]","status":"Forbidden"}}


[Relevant part of the Program]

# search for the document first

print("Performing a document search using document-text...")

docId = requestSearch(documentSearchText)

print("Document ID is: %s " % str(docId))


# get a signed download link for this document

print("")

print("Retrieving the document URL for this DocID...")

fileName, signedUrl = retrieveDocURL(docId)

print("Document fileName is: %s" % fileName)

print("Retrieval signedUrl is: %s" % signedUrl)


# download the document

print("")

print("Downloading the document: %s..." % fileName)

retrieveSaveDoc(fileName, signedUrl)


Please advise what is wrong with the client?

#technologyrdp-api
filings.zip (1.9 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
26.4k 62 17 14

Hello @Midori.Miyata1

I am not the Filing API expert, but this error message indicates that the client RDP account does not have scope "trapi.data.filings.retrieval" which is required to the API.

"message":"access denied. Scopes required to access the resource: [trapi.data.filings.retrieval]. Missing scopes: [trapi.data.filings.retrieval]","status":"Forbidden"

I strongly suggest you contact the client's Account Manager (or Sale representative) to verify the client account and scopes.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
8 2 2 2

Thank you for your help.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.