Use this resource to upload a Visio template XML file or image file to your organization. You can also use this resource to delete a Visio template XML file or image file from the organization.
POST Request
To upload a Visio template XML file or image file, use the following URI.
/api/v2/fileRecord
You can upload a file up to 5 MB in size.
Note: Encode the request body as multipart/form-data.
Use the following attributes in the request body:
Field
Type
Required
Description
file
Yes
Content of the file that you want to upload. File content should be in binary format, UTF-8 encoding.
type
String
Yes
Type of file that you want to upload. Use one of the following values:
- MAPPING. Use to upload a Visio template XML file. Use for XML files only.
- IMAGE. Use to update an image file for a Visio template. Use for JPEG or PNG files only.
In addition to the POST attributes, pass the following information in the request body:
•Boundary value. Used to define different parts of the request body.
•File name. The file name of the content you want to upload.
•icSessionId. Informatica Intelligent Cloud Services session ID returned by the login resource. You can pass this information in the request body for clients that do not allow custom headers. If you can pass icSessionId as part of the request header, you can omit this information in the request body.
Use the following template for the fileRecord POST request:
URL: <serverUrl>/api/v2/fileRecord/ HTTP method: POST
<icSessionID returned from login resource> --<boundary value>--
POST Response
Returns the fileRecord object if the upload is successful. Returns the error object if errors occur.
The fileRecord object includes the following attributes:
Field
Type
Description
id
String
ID for the uploaded file.
You can use this ID to identify the file when you create or update a Visio template with the masterTemplate resource.
orgId
String
Organization ID.
name
String
File name.
description
String
Description of the file.
createTime
Date/time
Time that the file was uploaded to the organization.
updateTime
Date/time
Last time that the file was updated.
createdBy
String
User who first uploaded the file.
updatedBy
String
User who last updated the file.
type
String
File type.
size
Int
File size.
attachTime
String
Time the file was associated with a Visio template.
DELETE Request
You can delete a Visio template XML or image file if the Visio template is not used by a Visio template.
To delete a file, use the file ID in the following URI:
/api/v2/fileRecord/<id>
DELETE Response
Returns the 200 response code if the request is successful.
Returns the error object if errors occur.
POST Example
To upload the VisioTemplate.xml file with an icSessionId of IV4wOrJmd6YUtmKa8t, you might use the following request. XML data should be encoded in UTF-8.
URL: https://example.informatica.com/saas/api/v2/fileRecord/ HTTP method: POST