Retrieve File
Files
This REST service allows you to retrieve a file you uploaded previously using the fileId.
Request
Use this call to retrieve an uploaded file using its fileId. This fileId was returned to you in the response on the Upload File request. The request does not have any additional input parameters.
Request example
This scenario you will probably use the most
-
await client.V1.WithNewMerchant("merchantId").Files.GetFile("fileId", (stream, headers) => { // Do something with stream and headers here. }); // Note: no SynchronizationContext will be available inside the body handler. // Should your body handler need the current one, you need to capture it first: var sc = SynchronizationContext.Current; await client.V1.WithNewMerchant("merchantId").Files.GetFile("fileId", (stream, headers) => sc.Send(delegate { // Do something with stream and headers here. }, null));
Responses
Please find below an overview of the possible responses.
Response 200 - OK
An HTTP 200 response is returned with the file when the request was successful.
The response will have a Content-Type header that describes what type of file it is. It will also have a Content-Disposition header with type "attachment" and the file's name. If it is known, there will be a Content-Length header with the file's size.
For example:
* Content-Type: application/
* Content-Disposition: attachment; filename="examplefile"
* Content-Length: 1234
Response example
This scenario you will probably use the most
-
<File content>
Response 404 - Not foundErrorResponse
No file was found for the given fileId.
Properties
|
|||
Property | Type | Required | Details |
---|---|---|---|
errorId | string | yes | read close |
close
DescriptionUnique reference, for debugging purposes, of this error response
|
|||
array of object | yes | read close | |
close
DescriptionList of one or more errors
|
|||
object | no | read close | |
category | string | no | read close |
close
DescriptionCategory the error belongs to. The category should give an indication of the type of error you are dealing with.
Possible values:
|
|||
code | string | yes | read close |
close
DescriptionError code
|
|||
httpStatusCode | integer | no | read close |
close
DescriptionHTTP status code for this error that can be used to determine the type of error
|
|||
id | string | no | read close |
close
DescriptionID of the error. This is a short human-readable message that briefly describes the error.
|
|||
message | string | no | read close |
close
DescriptionHuman-readable error message that is not meant to be relayed to customer as it might tip off people who are trying to commit fraud
|
|||
propertyName | string | no | read close |
close
DescriptionReturned only if the error relates to a value that was missing or incorrect.
Contains a location path to the value as a JSonata query. Some common examples:
|
|||
requestId | string | no | read close |
close
DescriptionID of the request that can be used for debugging purposes
|
Response example
This scenario you will probably use the most
-
{ "errorId" : "5c3365733fd1b84ac4cfcd0cf9ee69e4", "errors" : [ { "code" : "310400100", "id" : "DISPUTE_DATA_ERROR", "category" : "DISPUTE_SERVICE_ERROR", "httpStatusCode" : 404 } ] }