Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 649 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 649 Bytes

postmord

A Go API wrapper for the PostNord track and trace API

Example

$ go get -u github.com/antonjah/postmord
package main

import (
	"fmt"
	"github.com/antonjah/postmord"
)

func main() {
	client := postmord.NewClient("MyConsumerAPIKey", nil, postmord.DefaultOptions)
	response, err := client.FindByIdentifier("MyShipmentID")
	if err != nil {
		// handle error
	}

	for _, shipment := range response.TrackingInformation.Shipments {
		fmt.Println(shipment.ShipmentID, shipment.StatusText)
	}

	// JSON
	j, _ := response.JSON()

	// YAML
	y, _ := response.YAML()

	// XML
	x, _ := response.XML()
}

Author

@antonjah