Skip to main content

Postman

Introduction

This tutorial will guide you to use Postman for develop frontend applications. You can go to Postman official website to lean more

Postman

Postman is an application used for API testing. It is an HTTP client that tests HTTP requests, utilizing a graphical user interface, through which we obtain different types of responses that need to be subsequently validated.

Authentication

Authentication is the process of recognizing a user’s identity. It is the mechanism of associating an incoming request with a set of identifying credentials.

Graphql

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

Tutorials

Start backend service

Note: If you backend services is running, You can skip this process.

  1. go to _backend_service folder
cd <flutter-product/sveltekit-products>/_backend_service
  1. run backend service
make

Import postman tutorial collection

  1. open Postman and click import

  2. click upload and select postman tutorial.postman_collection.json from <flutter-product/sveltekit-products> directory

    init_registration

Register test user

  1. initiates a registration flow for API clients

    • go to authen/initialize registration flow

    • set method to GET ands set url to http://127.0.0.1:4433/self-service/registration/api

    • send a request

      init_registration

  2. register a new user

    • go to authen/complete registration flow

    • set method to POST and set url to http://127.0.0.1:4433/self-service/registration

    • set a query param flow with value <id from previous step>

      set_registration_req

    • set a json body

      {
      "method": "password",
      "password_identifier": "[email protected]",
      "password": "Secured112233445",
      "traits.emails": "[email protected]",
      "traits.name_full": "test",
      "traits.name_display": "test"
      }

      set_registration_req2

    • send a request

      registration_complete

Create a business unit

  • go to admin/businessUnitCreate

  • set header of the request: Foundation-Session-Token with value <session_token from previous step>

    alt text

  • send a request

    alt text

Create a product

  • go to admin/productCreate

  • set header of the request

    1. Foundation-Session-Token with value <session_token>
    2. Business-Unit with value business_unit_id from previous step

    alt text

  • set graphql variable :change location_id field to location_id from previous step

  • send a request

    alt text

List product

  • go to admin/productCreate

  • set header of the request

    1. Foundation-Session-Token with value <session_token>
    2. Business-Unit with value <business_unit_id>
  • send a request

    alt text