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:

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

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:

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:

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

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

Last updated

Was this helpful?