Skip to content

pacedotdev/pace

Repository files navigation

Welcome to Pace for Developers.

If you're new here, we recommend you take a few minutes to understand how Pace for Developers works:

On this page

Pace CLI

The Pace command line interface provides programatic access to Pace.

pace help
pace list
pace templates
pace <service>.<method> -Flags=value

See the help:

$ pace help

Check the version:

$ pace version

Go client library

To use the Go client:

go get github.com/pacedotdev/pace

Then import it into your code:

  • Use pace.New(apikey) to create a pace.Client with your API key (Read more about API keys in Pace)
  • Call the function to create the service you need (e.g. pace.NewCardsService) passing in the pace.Client
  • Call the methods on that service to access the Pace API

Here is a complete example:

package main

import (
	"context"
	
	"github.com/pacedotdev/pace"
)

func run(ctx context.Context) error {
	apikey := os.Getenv("PACE_API_KEY")
	secret := os.Getenv("PACE_API_SECRET")
	client := pace.New(apikey, secret)
	cardsService := pace.NewCardsService(client)
	
	resp, err := cardsService.GetCard(ctx, pace.CreateCardRequest{
		OrgID:  "your-org-id",
		CardID: "12",
	})
	if err != nil {
		return err
	}

	fmt.Println("Card 12:", resp.Card.Title)
}

func main() {
	ctx := context.Background()
	if err := run(ctx); err != nil {
		fmt.Fprintf(os.Stderr, "err: %s\n", err)
	}
}

Pace JSON/HTTP API

You can make plain old HTTP calls with JSON payloads to interact with Pace.

  • Make calls directly to https://pace.dev/api
  • Set the Content-Type header to application/json
  • Use POST method
  • Set X-API-KEY and X-API-SIGNATURE headers (Read more about API keys in Pace)
POST https://pace.dev/api/CardsService.GetCard
Content-Type: application/json
X-API-KEY: your-api-key

{
	"OrgID": "your-org-id",
	"CardID": "12",
}

The response varies depending on which method you're calling, but there is always an Error string field which is empty (along with a 200 status code) if the operation was successful.