Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 50 Next »

API documentation

Check out all details in our Swagger documentation.


Introduction

For integration purposes there are some APIs that are useful to import data into Plan & Go and also to be able to export.

Security / authentication

For each session, first get authenticated with /login/v-1, then use the received token in the header for all the other calls. Like this:

# Example 1) Posting JSON (when logged in, we send the token in the header)
curl https://api.planandgo.di.no/external/plan/v-1/create \
  -H "Content-Type:application/json" \
  -H "X-Auth-Token:olof:5f9a3609a5a295eff861d930a0c75bbee7991842" \
  -d "{ \
    \"companyId\": 1, \
    \"date\": '2015-12-04T12:00Z', \
    \"distrNo\": 0,
    \"name\": \"Utkjoring uke 9\" \
  }"


# Example 2) posting FILE (when logged in, we send the token in the header)
curl https://api.planandgo.di.no/external/plan/v-1/importOrderFile/1234/5678 \
  -H "Content-Type: multipart/form-data" \
  -H "X-Auth-Token: olof:5f9a3609a5a295eff861d930a0c75bbee7991842" \
  -F file=@my_import_file_in_this_dir.csv

Environments

  • DEV:Ā https://dev-planandgo.aws.di.no
  • STAGING: https://staging-planandgo.aws.di.no
  • PROD: https://api.planandgo.di.no

Parameters you need

  • companyId
  • customerSystemId
  • API-credentials (contactĀ info@di.noĀ to get access)

Most notable controllers

  • Plan (importing a plan)
  • Order (extracting orders)

Usage

When the deliveries are ready on your end

  • (Generate a token for the session)
  • Repeat these steps for each transport company
    • Create an empty routeplan, to get a fresh routePlanId (do this for each area that has it's own starting point)
    • Generate a file (using our file-spec) and post it. Remember to fill out ORDER_ID (used as key when exporting optimized plans)

When the plan is optimized and published (at a agreed time)

  • (GenerateĀ a token for the session)

  • Fetch the orders and extract the routename, estimater time etc from there (for a given customerSystem and distribution-date)

When the plan has been effectuated / performed

  • (GenerateĀ a token for the session)
  • Fetch the orders and extract the needed data (info about each order)

When a customer wants to be deleted from your system (GDPR)

  • Assumes that you have a full history of the customer's orderIds
  • GenerateĀ a token for the session
  • Call "purgeOrders" given all the customer's orders (for a given customerSystem)


  • No labels