Platform
Search…
Verification
These instructions will explain you about how to work with verification API.

Verification model fields

Verification model in database contains next fields:
    Required:
      id (uuid)
      state (FSMField with chooses: requested, open, pending, verified, revoked and rejected)
      block_number (IntegerField)
      granted_to_type (PositiveSmallIntegerField from 1 to 3)
      verifier_type (PositiveSmallIntegerField from 1 to 3)
      date_created (DateTimeField with auto add)
      date_last_modified (DateTimeField with auto add now)
    Optional:
      tx_hash (CharField)
      block_hash (CharField)
      certificate (ForeignKey to certificate, setting to Null, if certificate was deleted)
      granted_to (ForeignKey to user, setting to Null, if user was deleted)
      verifier (ForeignKey to user, setting to Null, if user was deleted)
      meta_ipfs_hash (CharField)

Verification View Set

Create new verification

Method create(self, request) acccepting POST requests with JSON information about new verification.
Returns
    If ok:
      Code status 200
      JSON with Verification data on bdn
    Else:
      Code status 400
      error JSON with errors
Example:
1
// POST Request to *your_bdn_host*/api/v1/verifications/
2
3
'/api/v1/verifications/',
4
data={
5
'verifier': '0x05',
6
'granted_to_type': 1,
7
'verifier_type': 2,
8
'certificate': '0cb19a83-d3c9-491b-99a3-374ebb01c43f',
9
},
10
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
11
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735'
Copied!

Get verification info

Method retrieve(self, request, pk=None) acccepting GET requests with verification id and reply with JSON information about verification.
Returns
    If ok:
      Code status 200
      JSON with Certificate data
    Else:
      Code status 400
Example
1
// GET Request to *your_bdn_host*/api/v1/verifications/(?P<pk>[^/.]+)/
2
3
'/api/v1/verifications/e0e433e9-477e-43a3-8e23-dfe2686202be/',
4
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
5
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735')
Copied!

Get verifications list

Method list(self, request) acccepting GET requests with inline get parameter active_profile: ('Academy', 'Business', 'Learner') and reply with JSON information about verification by verifier user.
Returns
    If ok:
      Code status 200
      JSON with Verifications list data by verifier user
Example:
1
// GET Request to *your_bdn_host*/api/v1/verifications/?active_profile=*String*
2
3
'/api/v1/verifications/?active_profile=Academy',
4
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
5
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735'
Copied!

Set state to open

Method set_open_by_id(self, request, pk=None) acccepting POST requests with verification id in line. Isuuer should be verifier of this verification.
Returns
    If ok:
      Code status 200
    Else:
      Code status 404
Example:
1
// POST Request to *your_bdn_host*/api/v1/verifications/(?P<pk>[^/.]+)/set_open_by_id/
2
3
'/api/v1/verifications/e0e433e9-477e-43a3-8e23-dfe2686202be/set_open_by_id/',
4
data={
5
},
6
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
7
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735'
Copied!

Set state to pending

Method set_pending_by_id(self, request, pk=None) acccepting POST requests with verification id in line. Isuuer should be verifier of this verification.
Returns
    If ok:
      Code status 200
    Else:
      Code status 404
Example
1
// POST Request to *your_bdn_host*/api/v1/verifications/(?P<pk>[^/.]+)/set_pending_by_id/
2
3
'/api/v1/verifications/e0e433e9-477e-43a3-8e23-dfe2686202be/set_pending_by_id/',
4
data={
5
},
6
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
7
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735'
Copied!

Set state to rejected

Method reject_by_id(self, request, pk=None) acccepting POST requests with verification id in line. Isuuer should be verifier of this verification.
Returns
    If ok:
      Code status 200
    Else:
      Code status 404
Example
1
// POST Request to *your_bdn_host*/api/v1/verifications/(?P<pk>[^/.]+)/reject_by_id/
2
3
'/api/v1/verifications/e0e433e9-477e-43a3-8e23-dfe2686202be/reject_by_id/',
4
data={
5
},
6
HTTP_AUTH_SIGNATURE='0xe646de646dde9cee6875e3845428ce6fc13d41086e8a7f6531d1d526598cc4104122e01c38255d1e1d595710986d193f52e3dbc47cb01cb554d8e4572d6920361c',
7
HTTP_AUTH_ETH_ADDRESS='D2BE64317Eb1832309DF8c8C18B09871809f3735'
Copied!
Last modified 2yr ago