Upload File Attachment v1

post

/file/upload

Upload a file type media object for the given structure and key. The 'moAdd' parameter takes a JSON string in the form of the MediaObjectUploadRequest class

Request

Supported Media Types
Header Parameters
Form Parameters
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
  • If this is an image and data was requested, this will contain a Base64 encoded string of the image, scaled down to thumbnail size based on the request.
  • An identifier for the device making the service call. If not provided, the requesting IP address is used.
  • For file type media objects this is the download URL needed ot download the item. Pass this value into a download request.
  • Specify the environment to use for login. If not specified, the default environment configured for the AIS Server will be used.
  • The location of the file for this media object.
  • The name of the form the media object is associated with (for example W01012A).
  • Indicates that this image was set as the default image for this media object structure and key.
  • Indicates the file is an image.
  • Indicates the item is an OLE item.
  • Indicates the item is a shortcut.
  • Indicates the item is a text type media object.
  • Indicates the item has been updated.
  • Indicates the item is a URL type media object.
  • The name of the media object item.
  • 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 media object type, 0-Text, 1-File, 5-URL.
  • 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.
  • If the file was from the media object queue, the queue name will be returned.
  • The role to use for login. If not specified, the default role configured for the AIS Server will be used.
  • The sequence number of the media object item.
  • The AIS token, which is required if other authentication methods are not being used.
  • The date the media object was last updated.
  • The hour of the day the item was last updated.
  • The minute of the hour of the day the item was last updated.
  • The second of the minute of the hour day the item was last updated.
  • The user that last updated the item.
  • 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).
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 Request

The following shows an example of a media object request to upload a file attachment. The token value is from a prior call to the token request service to establish a session. The file being uploaded is in this location: C:\temp\billards.jpg and it is an image/jpeg type. The JSON being sent is stored in this location and text file: C:\temp\upload.json.

curl -i POST "Content-Type:multipart/related" http://ais_server_url/jderest/file/upload  -F file="@C:\temp\billards.jpg;type=image/jpeg" -F moAdd="@C:\temp\upload.json;type=application/json"


Contents of file: C:\temp\upload.json:
{
    "token":"044HcnKxuypi6XVrCAtYtiAKcGHMpd9xA9HukRsiAyJY58=MDE5MDA4NjY0MTUzMTQ5MzQ4OTgxMjUyNk15RGV2aWNlMTQ4MjQzMTEzNTg0NQ==",
    "deviceName":"MyDevice",
    "ssoEnabled":false,
    "moStructure":"ABGT",
    "moKey":[
        "7500"
    ],
    "formName":"P01012_W01012B",
    "version":"ZJDE0001",
    "file":{
        "fileName":"billards.jpg",
        "fileLocation":"C:\\temp\\billards.jpg",
        "itemName":"Uploaded File APIs",
        "sequence":0
    }
}

Example Response

The following example shows the contents of the response body.

{
    "uniquefilename":"FILE-7226089643494364133-1482431140345.jpg",
    "itemName":"Uploaded File APIs.jpg",
    "sequence":2
}
Back to Top