0.0.2 • Published 1 year ago

@babbiorsetto/dhl-typescript-fetch-client v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Usage

import {RatingApi, Configuration} from '@babbiorsetto/dhl-typescript-fetch-client'

const config: Configuration = {
    username: 'MyApiKey',
    password: 'MyApiSecret'
}
const rating = new RatingApi(config, 'https://express.api.dhl.com/mydhlapi/test')

try {
    const resp = await rating.expApiRates('accountNumber', /*All required info*/)
    console.log(JSON.stringify(resp.products))
} catch(err) {
    console.log(err)
    // The body of the error message
    // Has a detailed description in the 'detail' field
    const errBody: SupermodelIoLogisticsExpressErrorResponse = await err.json()
    console.log(errBody.detail)
}

Full description of the API in the official documentation

0.0.2

1 year ago