API Test Keys

Fetch Document Content

GET
/v1/documents/:id/content

Click to copy

Use this endpoint to download an earlier uploaded document. The response is the raw file content (binary) with the original Content-Type header (for example, image/jpeg for an uploaded image), not a JSON object.

Is this page helpful?

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
2
-X GET https://api.razorpay.com/v1/documents/:id/content

Failure

1
{
2
"error":{
3
"status_code": 401,
4
"description":"The API `<key/secret>` provided is invalid.",
5
"code":"BAD_REQUEST_ERROR"
6
}
7
}
Path Parameters
id

*

string

The unique identifier of the document.

Errors

The API <key/secret> provided is invalid.

Error Status: 400

The API credentials passed in the API call differ from the ones generated on the Dashboard.

  • Different keys for test mode and live modes.
  • Expired API key.

Solution

_id is not a valid id.

Error Status: 400

  • The id is not 14 characters long.
  • The id is not alphanumeric.

Solution

Invalid file id provided or merchant is unauthorized to access the fileId(s) provided.

Error Status: 400

The id does not exist, or it belongs to a different merchant. The API returns the same error for both cases for security reasons (so callers cannot enumerate other merchants' document ids).

Solution

Fetch Document Content

GET
/v1/documents/:id/content

Click to copy

Use this endpoint to download an earlier uploaded document. The response is the raw file content (binary) with the original Content-Type header (for example, image/jpeg for an uploaded image), not a JSON object.

Is this page helpful?

Path Parameters
id

*

string

The unique identifier of the document.

Errors

The API <key/secret> provided is invalid.

Error Status: 400

The API credentials passed in the API call differ from the ones generated on the Dashboard.

  • Different keys for test mode and live modes.
  • Expired API key.

Solution

_id is not a valid id.

Error Status: 400

  • The id is not 14 characters long.
  • The id is not alphanumeric.

Solution

Invalid file id provided or merchant is unauthorized to access the fileId(s) provided.

Error Status: 400

The id does not exist, or it belongs to a different merchant. The API returns the same error for both cases for security reasons (so callers cannot enumerate other merchants' document ids).

Solution

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET]
2
-X GET https://api.razorpay.com/v1/documents/:id/content

Failure

1
{
2
"error":{
3
"status_code": 401,
4
"description":"The API `<key/secret>` provided is invalid.",
5
"code":"BAD_REQUEST_ERROR"
6
}
7
}