How to get products through API

  1. Get an Access Token.   Before getting a product, you need to get the Access Token
    HTTP Get method, submit the necessary information to this address:

    http://app.doubridge.com/oauth/authorize?state={{customer session state string}}&client_id={{customer client id}}&response_type=code&approval_prompt=auto&redirect_uri={{customer redirect url}}

    If the information is correct, you will get the following information:

    {
    “code”:
    “A7XSYrmzoXE7y0loOZ65hqXzvhXo30aV_Q1Dt_PIUYTREoiuyQaxANylTZXzPD2TwuucCe1FncQLajkrsGcQDCsK9amyctDSI8Uuw7kHZnTd-zaPK0iU3Bg9jpw-kdOVi3unGogf_wnHRjz7usc94iERrj1BUr8S_BWHw7P-LIcYfHvgWviua71maieXP66a-7takW86I-ozetY14RFSupvkqiCIXGkrhZI_
    docBp1AHTY9M0Og68pTDapczTavoXKgMq1mig3y1_vYDuXnLhKpOQNhwHyixRU1SeM_h2UtlkCCIPyokUDTrHS5EKkNoZ1Z0kfN2_qjkF5Gqg”,
    This code is only an EXAMPLE.
    “state”: “{{customer session state string}}”
     }

  2. Use the Code obtained in the previous step to exchange access tokens as follows:

    HTTP POST mode, submit the necessary information to this address in the form: http://app.doubridge.com/api/token
    The information in the form must provide:

    client_id={{Customer Client Id}}&client_secret={{Customer Client Secret}}&redirect_uri={{Customer Redirect Url}}&grant_type=authorization_code&code={{ The code obtained in the previous step }}

    If the information is correct, you will get the following information:

    {

    “access_token”: “W7cIO3_GtMIZM9sJFtbeg4tgy33QSF56W041mH-xiju4ca7MnlcoiUgujhr8xhIDy4KOaDp5dAH56E30yA6NpoGeoV3x2UvYl5Db-0eXg77uloTb9lOFCMksgGDpMUeTusT7Aw6k3kfFsGanlQqGJPQviIVer03lQ2J6RxiKIYTIUYihVWBDvkDPyikuCUj5RI0k2rvUdk28qnf5RcI8EjXst8JO
    jR8BORnpKfupvs_Ti5ymTyOvzv3tYjUpC3NYtFC2e-CQK9pwzKqP5uKKA”,

    This Token is only an EXAMPLE.

        “token_type”: “bearer”,

        “expires_in”: 2591999,

        “refresh_token”: “GEwEUGpoPjEMixNwf3K0xws5mFGw25N_geKuOMnlcoiUYTIUYihgujhpJbxlINBIr62chYQzcsa79fByKIN7cv-q9bj1YIN2IJeEYGOxdEtL0ACbk0ibM_x4ALh3txZQorKr5TB79hHjgkcn2Z-WKQ21nGjyT9rXhexFzXya9_Cnq6GCvT0oJJZjlvMyWIcwZEpbyCVATGFy2Bo0tlNaqr9bg-2kgr5HvF2Vk-vGpqZB3EwPi38OkFoAhtldw2uIS09nyp
    kKiG-qhg”

    }

    This Token is only an EXAMPLE.

  3. Use the access token for authentication, then get the information you need, such as products information:

    Get products by HTTP GET: http://app.doubridge.com/api/products

    Put the access token in the HTTP header: Authorization: Bearer {{Access token}}

    If the access token is valid, it will return a list of products in JSON format!