uploadPartyDocument

This method is used to upload a document and associate it with an individual party. A valid party must exist to make this request. A party can be created using the createParty endpoint. Files must be at least 1 kB cannot be larger than 100 MB. Accepted file types are pdf, jpg, jpeg, and png.

Request Parameters

ParameterRequiredTypeDescription
clientIDyesstringTransactAPI Client ID
developerAPIKeyyesstringTransactAPI Developer Key
partyIdyesstringParty ID that is generated by the API when a party is created (createParty)
documentTitleyesstringUploaded document title. Please use prefix "documentTitle0=" in the value of documentTitle field
file_nameyesstringUploaded document file name. Please use prefix "filename0=" in the value of file_name field
userfile0yesstringRaw file data. Specification of raw file data is application specific. Accepted file types are PDF, JPG, PNG, HEIC and BMP. Minimum file size is 1 kB. Maximum file size is 100 MB. Please refer to the Sample Requests section for reference implementations.
createdIpAddressyesstringRequested IP Address

Sample Requests

curl --location --request POST 'https://api-sandboxdash.norcapsecurities.com/tapiv3/index.php/v3/uploadPartyDocument' 
--form 'clientID=someclientid'
--form 'partyId=somepartyid'
--form 'createdIpAddress="42.106.177.219"' 
--form 'file_name="filename0=Testing Document Size12.pdf"' 
--form 'userfile0=@"/path/to/file"' 
--form 'documentTitle="documentTitle0= Testing Document Size12.pdf"' 
--form 'developerAPIKey=somedeveloperAPIkey'
import axios = from 'axios';

const apiHost = process.env.TAPI_HOST || 'https://api-sandboxdash.norcapsecurities.com';
const tapiUriSegment = 'tapiv3/index.php/v3';
const tapiUri = `${apiHost}/${tapiUriSegment}`;
const mimeType = 'application/json';

const tapi = axios.create({
  baseURL: tapiUri,
  timeout: 10000,
  headers: { accept: mimeType, 'content-type': mimeType },
});

const auth = {
  clientID: process.env.TAPI_CLIENT_ID,
  developerAPIKey: process.env.TAPI_API_KEY,
};

const uploadPartyDocument = (partyId, file) => {
  const data = new FormData();
  data.append('clientID', auth.clientID);
  data.append('developerAPIKey', auth.developerAPIKey);
  data.append('partyId', partyId);
  data.append('file_name', `filename0="${file.originalname}"`);
  data.append('documentTitle', `documentTitle0="${file.originalname}"`);
  data.append('userfile0', Readable.from(file.buffer), { filename: file.originalname });
  return tapi.post('/uploadPartyDocument', data, {
    timeout: 60000,
    headers: { ...data.getHeaders() },
  });
};

const partyId = /* create or fetch a valid party ID */
const fakeFile = {
  buffer: Buffer.from('a'.repeat(1e3)),
  originalname: 'test-party-file.pdf',
};

const response = await uploadPartyDocument(partyId, fakeFile);

expect(response.data).toStrictEqual(
  expect.objectContaining({
    statusCode: '101',
    statusDesc: 'Ok',
    document_details: 'Document has been uploaded Successfully',
  }),
);

Response Parameters

ParameterTypeDescription
statusCodestringAPI Status Code
statusDescstringAPI Status Description
document_detailsstringDocument has been uploaded

Sample Response

{
  "statusCode": "101",
  "statusDesc": "Ok",
  "document_details": "Document has been uploaded Successfully"
}

Test it Yourself!

Language
Click Try It! to start a request and see the response here!