Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-paycor

Go library for interacting with Paycor's Reporting API. This implements the minimum needed to generate & download an existing report. The magic is with implementing the authentication scheme they use.

You'll have to talk to them about getting access for your company.

Use

package main

import (
	"bytes"
	"encoding/csv"
	"fmt"
	"io"
	"log"

	"github.com/MikeAlbertFleetSolutions/go-paycor"
)

func main() {
	var err error

	// connection to paycor
	paycorClient := paycor.NewClient("xxx", "xxx", "secure.paycor.com")

	// get naughtylist report from paycor
	var naughtylist []byte
	naughtylist, err = paycorClient.GetReportByName("hr naughty list")
	if err != nil {
		log.Fatalf("%+v", err)
	}

	// csv
	r := csv.NewReader(bytes.NewReader(naughtylist))

	// process rows
	for {
		// read row
		var record []string
		record, err = r.Read()
		if err == io.EOF {
			break
		}
		if err != nil {
			log.Fatalf("%+v", err)
		}

		fmt.Printf("%#v\n", record)
	}
}

About

go library for interacting with the paycor's reporting api

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages