Download File Attachment v2

post

/jderest/v2/file/download

Allows the caller to download a file type media object.

Request

Supported Media Types
Header Parameters
Body ()
Input for request to download a file type media object attachment.
Root Schema : MediaObjectDownloadRequest
Type: object
Input for request to download a file type media object attachment.
Show Source
  • An identifier for the device making the service call. If not provided, the requesting IP address is used.
  • The download URL used to download the media object. If this is not already provided the service will get the URL.
  • Specify the environment to use for login. If not specified, the default environment configured for the AIS Server will be used.
  • The name of the form the media object is associated with (for example W01012A).
  • If the file is an image and you would like it to be resized before download, indicate the height.
  • The HTML (JAS) Server to use for login. If not specified, the default HTML Server configured for the AIS Server will be used.
  • moKey
    An array of media object key values. You must pass the values in the same order that they appear in the data structure. The key values will be converted into the bar delimited key of the media object record stored in the F00165 table.
  • The media object data structure name, for example GT0801 or ABGT, which is a key to the F00165 table where media objects are stored.
  • The JD Edwards EnterpriseOne password, which is required if other authentication methods are not being used.
  • Used for logging in with psToken. Primarily used by the HTML Server to establish a session with the AIS Server.
  • The role to use for login. If not specified, the default role configured for the AIS Server will be used.
  • The sequence of the media object record.
  • The AIS token, which is required if other authentication methods are not being used.
  • JD Edwards EnterpriseOne username, which is required if other authentication methods are not being used.
  • The version of the application the media object is associated with (for example ZJDE0001).
  • If the file is an image and you would like it to be resized before download, indicate the width.
Nested Schema : moKey
Type: array
An array of media object key values. You must pass the values in the same order that they appear in the data structure. The key values will be converted into the bar delimited key of the media object record stored in the F00165 table.
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successful Execution
Body ()
Root Schema : MediaObjectListResponse
Type: object
MediaObjectListResponse is the output of the media object list operation.
Show Source
Nested Schema : mediaObjects
Type: array
The list of media object items.
Show Source
Nested Schema : MediaObjectListItem
Type: object
MediaObjectListItem is an individual media object within the response returned from the list operation.
Show Source
Nested Schema : moKey
Type: array
An array of media object key values. You must pass the values in the same order that they appear in the data structure. The key values will be converted into the bar delimited key of the media object record stored in the F00165 table.
Show Source

400 Response

Bad Request - Invalid JSON Input

403 Response

Authorization Failure

415 Response

Invalid Content-Type Header - Must use application/json

444 Response

Invalid Token
Body ()
Root Schema : ServiceErrorResponse
Type: object
Error Response
Show Source

500 Response

Server Failed to Process Request
Body ()
Root Schema : ServiceErrorResponse
Type: object
Error Response
Show Source
Back to Top

Examples

Example Media Object Download Request - Output to Text

The following shows an example of a media object request to download a file attachment. The token value is from a prior call to the token request service to establish a session.

This example downloads the output to a text file, so you can view the raw output.

curl -i -X POST -H "Content-Type:application/json" http://ais_server_url/jderest/file/download -d @C:\temp\jsonFile.txt > c:\temp\billards.txt

Content of the JSON FILE jsonFile.txt:
{
    "token":"044aVG5ThVd+4g4/Sn7jiLLCompbz9Ab5dY9Zt0Vj5bra8=MDE5MDEzMzM1NjUwNzA5NzEyNTQ2Mzc4NDEwLjEzOS4xMTUuNTUxNDgyMjY3OTc4NDY3",
    "moStructure": "ABGT",
    "moKey": [
        "7500"
    ],
    "formName": "P01012_W01012B",
    "version": "ZJDE0001",
    "sequence": 2
}

Example Media Object Download Output

The following example shows the contents of the response in raw text form.

HTTP/1.1 200 OK
Date: Tue, 20 Dec 2016 21:12:17 GMT
Transfer-Encoding: chunked
Content-Type: application/octet-stream
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Origin: *

ff d8 ff e1 1f fe 45 78 69 66 20 20 49 49 2a 20 08 20 20 20 09 20 0f 01 02 20 06 20 20 20 7a 20 20 20 10 01 02 20 17 20 20 20 80 20 20 20 12 01 03 20 01 20 20 20 01 20 20 20 1a 01 05 20 01 20 20 20 a0 20 20 20 1b 01 05 20 01 20 20 20 a8 20 20 20 28 01 03 20 01 20 20 20 02 20 20 20 32 01  

Example Media Object Download Request - Output to File

This example downloads the output to a jpg file to save the actual file locally as the correct type . The file is saved to the location: c:\temp\billards.jpg

curl -i -X POST -H "Content-Type:application/json" http://ais_server_url/jderest/file/download -d @C:\temp\jsonFile.txt > c:\temp\billards.jpg

Content of the JSON FILE jsonFile.txt:
{
    "token":"044aVG5ThVd+4g4/Sn7jiLLCompbz9Ab5dY9Zt0Vj5bra8=MDE5MDEzMzM1NjUwNzA5NzEyNTQ2Mzc4NDEwLjEzOS4xMTUuNTUxNDgyMjY3OTc4NDY3",
    "moStructure": "ABGT",
    "moKey": [
        "7500"
    ],
    "formName": "P01012_W01012B",
    "version": "ZJDE0001",
    "sequence": 2
}
Back to Top