Skip to content

Submitting a contribution ​

NOTE

You must be signed in for this operation. See Authorizing an account.

To submit a contribution, perform the following steps:

  1. Assemble a contribution by sending the following request:

    http
    POST /data/api/v1/contribution-management/contribution/assemble
    json5
    [
      {
        id: 'string', //203.0.113.9 OR 203.0.113.9-203.0.113.20 OR +447700900201 OR +447700900201-+447700900209 OR 356938035643809 OR name@example.com OR https://scam.example.com/
        fraudType: 'string',
        origination: 'string',
        destination: 'string',
        sourcePeerId: 'string' //optional: the ID of another member company the data came from
      }
    ]
    json5
    [
      {
        id: '203.0.113.9',
        fraudType: 'IPFraud',
        origination: 'SE',
        destination: 'GB'
      }
    ]
    json5
    {
      status: {
        code: integer($int32),
        name: 'string'
      },
      data: 'transactionHex'
    }
    json5
    {
      status: {
        code: 0,
        name: 'Ok'
      },
      data: '01005657f2d4a10100003c6578616d706c655f74656c65636f6d1461646d696e0004080d08013c6578616d706c655f74656c65636f6d1461646d696e0d0234636f6e747269627574696f6e730d0149035b7b226964223a223230332e302e3131332e392d3230332e302e3131332e39222c226674223a332c226f7267223a225345222c22647374223a224742222c22737473223a302c226564223a313739373136363031342c22646f6d223a226578616d706c655f74656c65636f6d222c22616363223a2261646d696e222c22756964223a2230316131643466322d353735362d376438372d616631322d616162643434613730616339222c22737263223a226578616d706c655f74656c65636f6d222c227473223a313739343537343031347d5d01005c260500000000016e7d961200'
    }
  2. Sign the transactionHex string (see Signing transactions) retrieved from the response.

  3. Submit the assembled and signed contribution by sending the following request. The body is the signed Hex string as plain text, without quotes:

    http
    POST /data/api/v1/contribution-management/contribution
    text
    transactionHex(signed)
    text
    01040080bdebaf574c9dc2043a423acef76a4621924a405e713735ec8f21653abe3576a201017ae5b59defdf441dfd30a4b5383cba9fc63fbd21740582bf4322748a62bc9181a450dff5ff0a730ab406e142254238f848451e757dce2cd0035841155f6123025657f2d4a10100003c6578616d706c655f74656c65636f6d1461646d696e0004080d08013c6578616d706c655f74656c65636f6d1461646d696e0d0234636f6e747269627574696f6e730d0149035b7b226964223a223230332e302e3131332e392d3230332e302e3131332e39222c226674223a332c226f7267223a225345222c22647374223a224742222c22737473223a302c226564223a313739373136363031342c22646f6d223a226578616d706c655f74656c65636f6d222c22616363223a2261646d696e222c22756964223a2230316131643466322d353735362d376438372d616631322d616162643434613730616339222c22737263223a226578616d706c655f74656c65636f6d222c227473223a313739343537343031347d5d01005c260500000000016e7d961200
    json5
    {
      status: {
        code: integer($int32),
        name: 'string'
      },
      data: {
        tokenIds: [
          {
            definitionId: 'string', //the identifier of the stored record, followed by '#contribution'
            accountId: 'accountName@accountDomain'
          }
        ],
        rewarded: integer($int64)
      }
    }
    json5
    {
      status: {
        code: 0,
        name: 'Ok'
      },
      data: {
        tokenIds: [
          {
            definitionId: '01a1d4f2-5756-7d87-af12-aabd44a70ac9#contribution',
            accountId: 'admin@example_telecom'
          }
        ],
        rewarded: 10
      }
    }

Expected result ​

An assembled and signed contribution is submitted to the Exchange, the peer’s list of contributions is updated and their token balance is increased by the reward in force (see Rates in force).

NOTE

A record is rewarded once. An entry that the peer already holds as an active record with the same id and fraudType is not stored again and earns nothing; tokenIds then carries the identifier of the record already stored. Sending the same signed transaction again returns the first response. For details, see API reference > Submit an upload.

Every stored record counts towards the upload limit of the peer. An upload that would exceed it is refused as a whole with a 403 response (code 79).