Introduction

This quick start guide is meant to help you obtain your user credentials, generate an access token and make your first request to the EPCOM API.

The API allows you to fetch and search products, create and modify custom product listings, and obtain current product prices and availability in real time.


General specifications

  • Base URI: https://developers.epcom.net/api/v1/.
  • Each client is limited to a maximum 60 API requests per minute X-RateLimit-Limit→60.
  • Response type: Content-Type: application/json

1. Access token

Authentication follows the OAuth 2.0 protocol with the client_credentials flow.

credenciales

In order to obtain your access token you must generate your user credentials (client id and client secret) first.

You can login using your regular Epcom account and register a new app to obtain your Client ID and Client Secret.


Credentials

  • Client ID: Unique ID tied to your Epcom account.
  • Secret Client: Secure password to access the client.

Once you have your client credentials, you can use them to generate an access token.

credenciales

Warning: Your user credentials allow access to your Epcom account and should be stored safely.

Access token generation

Issue a new access token by sending a POST request to the following endpoint: https://developers.epcom.net/oauth/token.

  curl --request POST --url https://developers.epcom.net/oauth/token
  -H 'Content-Type: application/x-www-form-urlencoded'
  --data 'client_id={YOUR_CLIENT_ID}&client_secret={YOUR_CLIENT_SECRET}&grant_type=client_credentials'

You will get back a JSON response with three keys: token_type, expires_in and access_token. Access tokens have a default lifetime of 365 days.

{
    "token_type": "Bearer",
    "expires_in": 31536000,
    "access_token": "ACCESS_TOKEN"
}

2. Fetching resources

Once you have an ACCESS_TOKEN, add it to the Authorization header as shown below:

    curl "https://developers.epcom.net/api/v1/{RESOURCE}"
    -H "Authorization: Bearer ACCESS_TOKEN"
Note: The authorization header should include the token type Bearer as well as the token value.

Sample request

What follows is a sample request and sucessful response to the categories endpoint.

For further information please refer to the full API Documentation. Read the docs.

Request

curl --request GET \
  --url https://developers.epcom.net/api/v1/categories \
  --header 'Authorization: Bearer  TOKEN_VALUE'

Response

[
    {
        "id": "22",
        "name": "Video Surveillance",
        "level": 1
    },
    {
        "id": "25",
        "name": "Radio Communication",
        "level": 1
    },
    {
        "id": "26",
        "name": "Networking",
        "level": 1
    },
    {
        "id": "27",
        "name": "GPS, Light Bars   and Traffic Control",
        "level": 1
    },
    {
        "id": "30",
        "name": "Energy",
        "level": 1
    },
    {
        "id": "32",
        "name": "IntrusionSystems",
        "level": 1
    },
    {
        "id": "37",
        "name": "Access Control",
        "level": 1
    },
    {
        "id": "38",
        "name": "FireDetection",
        "level": 1
    },
    {
        "id": "65811",
        "name": "Structured Cabling",
        "level": 1
    }
]