Upload a Document Using API

The Documents module of Fairways Debt stores all your documents. You can upload documents using API.

 

Prerequisites

 

Enter this command to upload a file:

curl -XPOST -v --header 'X-App-Token: Account's API-TOKEN ' --header 'content-type: application/xml'  -d '

<upload xmlns="http://www.financeactive.com/schemas/documents/v1"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   

<document>

<name>[File name]</name>
      <type>[Document type code]</type>

<metas>
    <meta>
        <key>[Metadata code]</key>
        <value xsi:type="xs:[Metadata type]">[Value]</value>
    </meta>
    <meta>
        <key>[Metadata code]</key>
        <value xsi:type="xs:[Metadata type]">[Value]</value>
    </meta>
</metas>

<links>
       <link>
            <type>[Transaction type]</type>
            <id>[External reference of the transaction]</id>
        </link>
</links>

<content>
        [**Base64 document**]
</content>

    </document>

</upload>

' '[Endpoint URL of the platform]'


 

 

Enter this command to upload a document from a URL:

curl -XPOST -v --header 'X-App-Token: Account's API-TOKEN ' --header 'content-type: application/xml'  -d '

<upload xmlns="http://www.financeactive.com/schemas/documents/v1"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   

<document>

<name>[File name]</name>
      <type>[Document type code]</type>

<links>
       <link>
            <type>[Transaction type]</type>
            <id>[External reference of the transaction]</id>
        </link>
</links>

<url>[URL redirecting to the document]</doc>

    </document>

</upload>

' '[Endpoint URL of the platform]'


 

 

Example 1: Upload of a file

You want to upload this document:

Document Name

Test_doc.pdf

Document Type

Contract

Transaction ID External Reference

123456

Metadata

  • Color: Gold
  • Year: 2020
  • VIP (True/False): True

 

  1. Create a document type with the Contract code.
  2. Create 3 metadata:
    • Code: Color, Type: Text
    • Code: Year, Type: Long
    • Code: VIP, Type: Boolean
  3. Enter this command:
curl -XPOST -v --header 'X-App-Token: Account's API-TOKEN ' --header 'content-type: application/xml'  -d '

<upload xmlns="http://www.financeactive.com/schemas/documents/v1"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   

<document>
    <name>Test_doc</name>
      <type>Contract</type>

<metas>

<meta>
<key>Color</key>
<value xsi:type="xs:string">Gold</value>
</meta>

    <meta>
<key>Year</key>
<value xsi:type="xs:long">2020</value>
</meta>

    <meta>
<key>VIP</key>
<value xsi:type="xs:boolean">true</value>
</meta>

</metas>

      <links>
<link>
<type>Deal</type>
<id>123456</id>
</link>
</links>

      <content>
       **Base64 document**
      </content>

    </document>

</upload>

' 'https://debt.financeactive.net/rest/documents/upload'

 

Example 2: Upload a document from a URL

You want to upload this document:

Document Name

Invoice_doc

Document Type

Invoice

Transaction ID External Reference

789012

URL

https://www.mycompany.com/url_to_my_doc

 

  1. Create a document type with the Invoice code.
  2. Enter this command:
curl -XPOST -v --header 'X-App-Token: Account's API-TOKEN ' --header 'content-type: application/xml'  -d '

<upload xmlns="http://www.financeactive.com/schemas/documents/v1"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">   

<document>
   <name>Invoice_doc</name>
     <type>Invoice</type>

      <links>
<link>
<type>Deal</type>
<id>789012</id>
</link>
</links>

     <url>https://www.mycompany.com/url_to_my_doc</url>

    </document>

</upload>

' 'https://debt.financeactive.net/rest/documents/upload'

Note: We recommend using the latest API version.

See also https://developer.financeactive.com/api.html for more details. We recommend using the latest API version.

Was this article helpful?
0 out of 0 found this helpful