Code Monkey home page Code Monkey logo

pyrusapi-go's Introduction

pyrusapi-go

GoDoc Widget Go Report codecov test lint

Library to work with Pyrus API v4 written in Golang.

Install

go get github.com/L11R/pyrusapi-go

Quick Start

package main

import (
	"fmt"
	"log"

	"github.com/L11R/pyrusapi-go"
)

func main() {
	c, err := pyrus.NewClient("bot_login", "bot_security_key")
	if err != nil {
		log.Fatalln(err)
	}

	p, err := c.Profile()
	if err != nil {
		log.Fatalln(err)
	}

	fmt.Println(p.FirstName)
}

Current status

Forms:

  • GET /forms
  • GET /forms/{form-id}
  • GET /forms/{form-id}/register

Tasks:

  • GET /tasks/{task-id}
  • POST /tasks
  • POST /tasks/{task-id}/comments

Files:

  • POST /files/upload
  • GET /files/download/{file-id}

Catalogs:

  • GET /catalogs
  • GET /catalogs/{catalog-id}
  • PUT /catalogs
  • POST /catalogs/{catalog-id}

Contacts:

  • GET /contacts

Members:

  • GET /members
  • POST /members
  • PUT /members/{member-id}
  • DELETE /members/{member-id}

Lists:

  • GET /lists
  • GET /lists/{list-id}/tasks
  • GET /inbox

Telephony:

  • GET /calls
  • PUT /calls/{call-guid}
  • POST /calls/{call-guid}/event

Webhooks:

  • Use WebhookHandler() (http.HandlerFunc, <-chan Event)

Tests

To test project you have to download sample responses from your organization. I cannot upload my own, because it could contain sensitive information, and I'm too lazy to fake it :)

Set those environment variables and run tests:

PYRUS_LOGIN=login
PYRUS_SECURITY_KEY=securityKey
PYRUS_FORM_ID=123456
PYRUS_TASK_ID=123456
PYRUS_CATALOG_ID=123456
PYRUS_MEMBER_ID=123456
PYRUS_ROLE_ID=123456
PYRUS_LIST_ID=123456
PYRUS_FILE_ID=123456
PYRUS_CALL_GUID=5d8dc3d6-27e7-4cd4-a057-2b4f4d74e0a5

pyrusapi-go's People

Contributors

dependabot[bot] avatar savely-krasovsky avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

lookatshow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.