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?

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    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.

Answers