Skip to content

YervandBag/accredify

Repository files navigation

Certificate Verification API

This Laravel application provides an API endpoint for verifying certificates. The verification process checks the validity of the recipient, issuer, and certificate signature using a VerificationService. The application also includes a JsonContentValidator to validate JSON input data.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/username/certificate-verification-api.git
    cd certificate-verification-api
  2. Install dependencies:

    composer install
  3. Create a copy of the .env file:

    cp .env.example .env
  4. Generate an application key:

    php artisan key:generate
  5. Configure your database and other environment variables in the .env file f needs.

  6. Run the database migrations:

    php artisan migrate
  7. Start the development server:

    php artisan serve

    The application should now be running on http://localhost:8000.

API Endpoints

Verify Certificate

URL

POST /api/verify

Description

This endpoint accepts a JSON file request containing certificate data and validates it. The certificate's recipient, issuer, and signature are verified.

Request Body

  • json_file

Using the /api/verify Endpoint

Request Example with JSON File

To use the /api/verify endpoint with a JSON file, follow these steps:

  • In the root folder we have certificate.json file
  1. Use curl to send the request with the JSON file:

    curl -X POST http://localhost:8000/api/verify \
         -H "Content-Type: application/json" \
         -d @certificate.json
  2. Response Example:

{
    "data": {
        "issuer": "Accredify",
        "result": "invalid_issuer"
    }
}

Verification History

URL

GET /api/history

Swagger Docs

URL

GET /api/documentation

Testing

To run the tests, use the following command:

php artisan test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages