Git Product home page Git Product logo

documentationapi's Introduction

Laravel Logo

API Documentation V1 [Version One]

This document outlines the functionalities and usage of the Laravel API for managing customers and invoices. Secure access is ensured through Laravel Sanctum token authentication.

Technologies Used

Authentication

The API utilizes Laravel Sanctum for token-based authentication. To access protected endpoints, users need to generate a token using their login credentials.

  1. Generating a Token:
  • Send a GEt request to /setup and it will generate thsi default user that will be used to generate the tokens that will be used to access the tokens:
{
  "email": "[email protected]",
  "password": "password"
}
  • A successful response will include a token field containing the 3 access tokens.
  • Basic token
  • Admin token
  • Update token
  1. Including the Token in Requests:
  • Include the access token in the authorization header of all subsequent requests. Here's an example using curl:
curl -X GET https://your-api-domain/api/v1/customers \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Important Note:

Store the access token securely and avoid exposing it in client-side code.

API Endpoints

The API is organized with a base URI of /api/v1. Here's a breakdown of the available endpoints:

Customers:

  • GET /customers: Retrieve a list of all customers.
  • GET /customers/{id}: Get details of a specific customer by their ID.
  • POST /customers: Create a new customer.
  • PUT /customers/{id}: Update an existing customer[all fields].
  • PATCH /customers/{id}: Update a single existing customer field.
  • DELETE /customers/{id}: Delete a customer.

Invoices:

  • GET /invoices: Retrieve a list of all invoices.
  • GET /invoices/{id}: Get details of a specific invoice by their ID.
  • POST /invoices: Create a new invoice.
  • PUT /invoices/{id}: Update an existing invoice[all fields].
  • PATCH /invoices/{id}: Update a single existing invoice field.
  • DELETE /invoices/{id}: Delete a invoice.

Screenshot from 2024-05-27 13-47-55

Additional Features

  • Bulk Invoice Insertion
  • Customer and Invoice Filtering using operator custom patterns..

For more info, please refer to the more detailed api documentation.

Screenshot from 2024-05-27 13-48-26

  • Documentation Home page

Additional Notes: Screenshot from 2024-05-27 13-48-26

Specific details about request parameters and response structures can be found in the controller code within your project. Error responses will be formatted as JSON objects with an error message and relevant details (e.g., validation errors).

Example Usage:

  • Generate a token using the /login endpoint.
  • Use the retrieved token in subsequent requests with the Authorization header.
  • Refer to the specific endpoint documentation for details on request parameters and expected responses.

This is a basic documentation structure. You can expand on it by including:

  • Specific request parameters for each endpoint (e.g., required fields, data types).
  • Expected response structure (including data fields and their meanings).
  • Authentication error codes and their descriptions.
  • Example code snippets for making API calls in different languages.
  • Remember to update this documentation as your API evolves and add new functionalities.

Thanks for checking out my repo

vernonthedev

documentationapi's People

Contributors

vernonthedev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.