File Upload using API
POST API Endpoint
The Post method should be used when a file upload for Digital Asset is requested.
Note:
The Delete and Put methods are not valid and hence not supported.The API endpoint is as follows:
https://environmentname/tenancy/api/DigitalAsset/v1/DigitalAssetMaster- Replace the environmentname with your specific URL information specific to your Service endpoint.
- Replace tenancy with the target tenancy (non-prod, pre-prod or prod) within the environment.
Example,
https://futurabank/non-prod/api/DigitalAsset/v1/DigitalAssetMaster
Headers
There are several headers that may be required by the methodology utilized to call the Post method on the API. The intention here is to identify those that have special consideration or maybe considered optional for other API calls.
- The standard "Content-Type" header should be set to "application/json".
- The standard "Authorization" header must be set to "Bearer Token" where Token is the authentication token provided by a call to the OAuth access API. For more information, refer to the Authorization topic.
Request
The body of the post is JSON and must identify the configuration and the data to be used to retrieve the Digital Asset(s). The body may also contain optional elements as described below.
{
"DigitalAssetRec": {
"DigitalAssetInfo": {
"MarketingCompanyShortName": "Marketing Company Name",
"DigitalAssetTransactionType": "Communication",
"DigitalAssetDetailConfigUuid": "Digital Asset Version Detail Config UUID ",
"DigitalAssetConfigEffDt": "Active date of the configuration to be considered for uploading Digital Asset ",
"Asset": "PDF File Base64 data",
"DigitalAssetData": "Escaped JSON data"
}
}
}
Elements
-
MarketingCompanyShortName: The Marketing Company Short Name is the name of the Marketing Company whose DigitalAsset Configuration should be used. DigitalAssetTransactionType: Currently the supported value is ‘Communication’ only and this can be enhanced in the future if there is a need for other services for Comms Cloud to consume Digital Asset service.DigitalAssetDetailConfigUuid: This is UUID of the Digital Asset Version Detail Config record which acts like a storage repository.DigitalAssetConfigEffDt: This is Effective Date to be considered to identify the appropriate Digital Asset Version Config record against which the uploaded Digital Asset will be mapped to.Asset: This represents the PDF file in the base64 format.DigitalAssetData: This represents the PDF file metadata in the escaped JSON data format.
Response
The response will return an appropriate status code (201, 404, etc.) but will also include a body that contains details of the stored asset.
GET API Endpoint
The GET method should be used to retrieve the Digital Asset based on the previous POST operation results.
The API endpoint is as follows:
https://environmentname/tenancy/api/DigitalAsset/v1/DigitalAssetMaster/{{DigitalAssetUuid of POST Operation result}}- Replace the environmentname with your specific URL information specific to your Service endpoint.
- Replace tenancy with the target tenancy (non-prod, pre-prod or prod) within the environment.
Example:
https://futurabank/non-prod/api/DigitalAsset/v1/DigitalAssetMaster/{{DigitalAssetUuid}}?returnOutputInd=true
Headers
There are several headers that may be required by the methodology utilized to call the GET method on the API. The intention here is to identify those that have special consideration or maybe considered optional for other API calls.
- The standard "Content-Type" header should be set to "application/json".
- The standard "Authorization" header must be set to "Bearer Token" where Token is the authentication token provided by a call to the OAuth access API. For more information, refer to the Authorization topic.
Parameters
The following inline parameter can be added to the GET request.
returnOutputInd: A Boolean value that when set to true will include the Base64 details of the retrieved DigitalAsset in the response.