NDAX
  • Introduction
    • About NDAX
    • Purpose
  • General Information
  • FIX
    • FIX Straight Through Processing
    • Supported Message Type
    • Resources
    • Sequence Diagram
    • Header & Trailer
    • Administrative Message
      • Logon (35=A)
      • Heartbeat (35=0)
      • TestRequest (35=1)
      • ResendRequest (35=2)
      • Reject (35=3)
      • SequenceReset (35=4)
      • Logout (35=5)
    • Application Message
      • TradeCaptureReport (35=AE)
      • TradeCaptureReportAck (35=AR)
    • Message Component
      • RootParties
      • TrdCapRptSideGrp
      • Parties
  • Web API
    • Endpoints
    • Time
  • Private Endpoints
    • Authentication
    • Index
    • Trades
      • GET Trade
      • POST Trade
      • Batch Trades
    • Positions
      • GET Position
      • GET Platform Position
    • Accounts
      • GET Status
      • Delivery
      • Account
      • History
      • Movement
    • Deposits
      • GET
      • GET: Digital Asset Address
      • POST: Digital Asset Address
      • GET: Fiat Deposit
      • GET: Withdrawal
        • GET: Withdrawal by ID
        • GET: Digital Asset
        • Digital Asset by ID
        • Fiat
        • Fiat by ID
      • Gas Fees
      • POST: Withdrawal
      • Delete: Withdrawal
    • Transfers
      • POST: Transfer
      • GET: Transfer by ID
    • Participants
      • GET
      • GET by Email
      • POST New
      • Region
      • Patch
      • Relation
      • Documents
    • Liquidity
      • GET
      • POST
    • Convert
    • Withdraw
    • Payments
      • POST
      • GET
      • GET Status
    • Rewards & Loyalty
    • Awards
  • Private Socket Feed
    • Overiew
    • Authentication
    • Basic Setup
    • Balances
    • Prices
    • Subscription
  • Security
    • Don't
    • Bounty
  • Contact
Powered by GitBook
On this page
  1. Private Endpoints
  2. Participants

Documents

POST /participants/documents

const postParticipantDocument = (filepath) => {
  const document = fs.readFileSync(filepath).toString('base64')

  const body = {
    document,
    mime: 'pdf',
    file_name: 'supporting_document.pdf',
    participant_code: 'ABC123'
  }

  const timestamp = Math.round(Date.now() / 1000)
  const payload = timestamp + 'POST' + '/participants/documents' + JSON.stringify(
    {})
  const decodedSecret = Buffer.from(apiSecret, 'base64')
  const hmac = crypto.createHmac('sha256', decodedSecret)
  const signedPayload = hmac.update(payload).digest('base64')

  const fileHash = crypto
    .createHash('sha256')
    .update(body.document)
    .digest('base64')

  // SET HEADERS
 const headers = {
    'X-NDAX-API-KEY': 'public_key',
    'X-NDAX-SIGNED': signedPayload,
    'X-NDAX-TIMESTAMP': timestamp,
    'X-NDAX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    body,
    json: true
  }

  return request.post(
    `https://api.ndax.in/participants/documents`,
    options
  )
}

Sample Request

{
  "document": "aGVsbG8gd29ybGQ=",
  "mime": "pdf",
  "file_name": "supporting_document.pdf",
  "participant_code": "ABC123"
}

Sample Response

{
  "message": {
    "state": "Success",
    "file_name": "supporting_document.pdf",
    "created_at": 1572899177383
  }
}

Submits a document on behalf of you or a customer if you operate a platform on NDAX. In order to Authenticate you will need to do the following:

  • Set your X-NDAX-FILE-HASH header to the sha256 hash (in a byte array) of your file contents and encode this data to base64 string.

  • Make sure to use {} as your body when signing your request. If you use your actual request body to sign you will receive and Invalid Client Signature.

  • Ensure that your file is not larger than 10mb.

  • Remember to base 64 encode your file before sending it to us.

You will need to add an additional "X-NDAX-FILE-HASH" header to make this request.

Request body:

Parameter
Description
Type

document

base 64 encoded file that you wish to upload (10mb limit)

binary

mime

The MIME type of the file you are uploading

string

file_name

The name of the document that you are uploading

string

participant_code

Your participant code, or the participant_code of the customer on behalf of whom you are uploading the document

string

PreviousRelationNextLiquidity

Last updated 2 years ago