REST API Reference > Data Integration REST API > fileRecord
  

fileRecord

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:
Use the following template for the fileRecord POST request:
URL: <serverUrl>/api/v2/fileRecord/
HTTP method: POST

Content-Type:multipart/form-data;boundary=<boundary value>
--<boundary value>
Content-Disposition:form-data; name="file";filename="<filename.ext>";Content-Type:text/<xml|json>

<content of the file you want to upload encoded as UTF-8>

--<boundary value>
Content-Disposition: form-data; name="type"

<MAPPING | IMAGE>
--<boundary value>
Content-Disposition: form-data; name="icSessionId"

<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

Content-Type:multipart/form-data;boundary=243553118520053
--243553118520053
Content-Disposition:form-data; name="file";filename="<VisioTemplate.xml>";Content-Type:text/xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Graph SYSTEM "graph.dtd">
<Graph Name="" Description="" UItype="" DlgSize="">
<Groups />
<Parameters>
<Parameter Name="$EXTERNALID__C$" Label="" LabelWidth="" IsMandatory="True" DefaultValue="" Control="" Data="" Description="" />
<Parameter Name="$TGT$" Label="" LabelWidth="" IsMandatory="True" DefaultValue="" Control="Combo_Ctrl" Data="Targets" Description="" />
<Parameter Name="$GroupBy$" Label="" LabelWidth="" IsMandatory="True" DefaultValue="" Control="" Data="" Description="" />
<Parameter Name="$o_PERCENT_FLD__C$" Label="" LabelWidth="" IsMandatory="True" DefaultValue="" Control="" Data="" Description="" />
<Parameter Name="$SRC$" Label="" LabelWidth="" IsMandatory="True" DefaultValue="" Control="Combo_Ctrl" Data="Sources" Description="" />
</Parameters>
<Node NameID="Source Definition" Name="$SRC$" Reusable="" Type="Source Definition" InstanceName="$SRC$" Description="" isParameterized="True">
<CustomProperty Name="Source Table" Value="$SRC$" isParameterized="True" />
<CustomProperty Name="Database Name" Value="" isParameterized="False" />
<CustomProperty Name="Owner Name" Value="" isParameterized="False" />
<CustomProperty Name="Business Name" Value="" isParameterized="False" />
<CustomProperty Name="Database Type" Value="" isParameterized="False" />
<CustomProperty Name="Is ShortCut" Value="False" isParameterized="False" />
</Node>
.
.
.
<Link Name="Sheet.7" FromNameID="Aggregator" ToNameID="Target Definition" MasterInputSet="False" isParameterized="False">
<Rule Text="Datatype:string" isParameterized="False" />
<Rule Text="EXCLUDE Named:AUTO__C (TO) AUTO__C" isParameterized="False" />
<Rule Text="Datatype:date/time" isParameterized="False" />
<Rule Text="Pattern:_o$" isParameterized="False" />
<Rule Text="Datatype:nstring" isParameterized="False" />
<Rule Text="Datatype:ntext" isParameterized="False" />
<Rule Text="Datatype:text" isParameterized="False" />
</Link>
</Graph>

--243553118520053
Content-Disposition: form-data; name="type"

MAPPING
--243553118520053
Content-Disposition: form-data; name="icSessionId"

IV4wOrJmd6YUtmKa8t
--243553118520053--
If the upload is successful, returns the fileRecord response object.