If you're new here, we recommend you take a few minutes to understand how Pace for Developers works:
The Pace command line interface provides programatic access to Pace.
pace help
pace list
pace templates
pace <service>.<method> -Flags=valueSee the help:
$ pace helpCheck the version:
$ pace version- What next? To learn more, see the Pace CLI documentation
To use the Go client:
go get github.com/pacedotdev/paceThen import it into your code:
- Use
pace.New(apikey)to create apace.Clientwith 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 thepace.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)
}
}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-Typeheader toapplication/json - Use
POSTmethod - Set
X-API-KEYandX-API-SIGNATUREheaders (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.
