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:

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]'


 

 

Example

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'

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