hellosign

package module
v0.0.0-...-38798c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2015 License: MIT Imports: 9 Imported by: 0

README

HelloSign Go SDK

A Go wrapper for the HelloSign API.

Not Ready For Release

The official library for using the HelloSign API for golang.

Usage

go get github.com/HelloFax/hellosign-go-sdk

Create a client:

client := hellosign.Client{APIKey: "ACCOUNT API KEY HERE"}
Signature Request Methods
Create Embedded Signature Request Using Files
  fileOne, _ := os.Open("public/offer_letter.pdf")
  defer fileOne.Close()
  fileTwo, _ := os.Open("public/offer_letter.pdf")
  defer fileTwo.Close()

  request := hellosign.EmbeddedRequest{
    TestMode: true,
    ClientId: os.Getenv("HS_CLIENT_ID"),
    File: []*os.File{
      fileOne,
      fileTwo,
    },
    Title:              "cool title",
    Subject:            "awesome",
    Message:            "cool message bro",
    SigningRedirectURL: "https://google.com",
    Signers: []hellosign.Signer{
      hellosign.Signer{
        Email: "freddy@hellosign.com",
        Name:  "Freddy Rangel",
        Pin:   "1234",
        Order: 1,
      },
      hellosign.Signer{
        Email: "frederick.rangel@gmail.com",
        Name:  "Frederick Rangel",
        Pin:   "1234",
        Order: 2,
      },
    },
    CCEmailAddresses: []string{
      "no@cats.com",
      "no@dogs.com",
    },
    UseTextTags:  false,
    HideTextTags: true,
    Metadata: map[string]string{
      "no":   "cats",
      "more": "dogs",
    },
    FormFieldsPerDocument: [][]hellosign.DocumentFormField{
      []hellosign.DocumentFormField{
        hellosign.DocumentFormField{
          APIId:    "api_id",
          Name:     "display name",
          Type:     "text",
          X:        123,
          Y:        456,
          Width:    678,
          Required: true,
          Signer:   0,
        },
      },
      []hellosign.DocumentFormField{
        hellosign.DocumentFormField{
          APIId:    "api_id_2",
          Name:     "display name 2",
          Type:     "text",
          X:        123,
          Y:        456,
          Width:    678,
          Required: true,
          Signer:   1,
        },
      },
    },
  }
  response, err := client.CreateEmbeddedSignatureRequest(request)
  if err != nil {
    log.Fatal(err)
  } else {
    fmt.Println(response)
  }

License

The MIT License (MIT)

Copyright (C) 2015 hellosign.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey     string
	BaseURL    string
	HTTPClient *http.Client
}

func (*Client) CreateEmbeddedSignatureRequest

func (m *Client) CreateEmbeddedSignatureRequest(
	embeddedRequest EmbeddedRequest) (*http.Response, error)

type DocumentFormField

type DocumentFormField struct {
	APIId    string `json:"api_id"`
	Name     string `json:"name"`
	Type     string `json:"type"`
	X        int    `json:"x"`
	Y        int    `json:"y"`
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	Required bool   `json:"required"`
	Signer   int    `json:"signer"`
}

type EmbeddedRequest

type EmbeddedRequest struct {
	TestMode              bool                  `form_field:"test_mode"`
	ClientId              string                `form_field:"client_id"`
	FileURL               []string              `form_field:"file_url"`
	File                  []*os.File            `form_field:"file"`
	Title                 string                `form_field:"title"`
	Subject               string                `form_field:"subject"`
	Message               string                `form_field:"message"`
	SigningRedirectURL    string                `form_field:"signing_redirect_url"`
	Signers               []Signer              `form_field:"signers"`
	CCEmailAddresses      []string              `form_field:"cc_email_addresses"`
	UseTextTags           bool                  `form_field:"use_text_tags"`
	HideTextTags          bool                  `form_field:"hide_text_tags"`
	Metadata              map[string]string     `form_field:"metadata"`
	FormFieldsPerDocument [][]DocumentFormField `form_field:"form_fields_per_document"`
}

type Signer

type Signer struct {
	Name  string `field:"name"`
	Email string `field:"email"`
	Order int    `field:"order"`
	Pin   string `field:"pin"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL