jotform

package module
v2.0.0-alpha-3+incompa... Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: GPL-2.0 Imports: 10 Imported by: 0

README

jotform-api-go

JotForm API - GO Client

Strongly consider using v2 of the jotform-api-go client!!

v1 works for user scripts, but is unsafe for use in long-running servers. It also silently hides some errors, and is generally less useable than v2.

Installation

Install via git clone:

    $ git clone git://github.com/jotform/jotform-api-go.git
    $ cd jotform-api-go
Documentation

You can find the docs for the API of this client at https://api.jotform.com/docs/

Authentication

JotForm API requires API key for all user related calls. You can create your API Keys at API section of My Account page.

Examples

Get latest 100 submissions ordered by creation date

package main

import (
        "jotform-api-go"
        "fmt"
)

func main() {

    jotformAPI := jotform.NewJotFormAPIClient("YOUR API KEY")

    submissions := jotformAPI.GetSubmissions("", "100", nil, "created_at")
    fmt.Println(string(submissions))
}

Submission and form filter examples

package main

import (
        "jotform-api-go"
        "fmt"
)

func main() {

    jotformAPI := jotform.NewJotFormAPIClient(
        "YOUR API KEY",
        "json", // or "xml", depending on how you want results to be formatted
        false,  // when true, this prints debugging information on each request
    )


    submissionFilter := map[string]string {
            "id:gt": "FORM ID",
            "created_at:gt": "DATE",
    }

    submissions := jotformAPI.GetSubmissions("", "", submissionFilter, "")
    fmt.Println(string(submissions))

    formFilter := map[string]string {
            "id:gt": "FORM ID",       
    }

    forms := jotformAPI.GetForm("", "", formFilter, "")
    fmt.Println(string(forms))
}

First the jotform package is imported from the jotform-api-go/JotForm.go file. This package provides access to JotForm's API. You have to create an API client instance with your API key. In case of an exception (wrong authentication etc.), you can catch it or let it fail with a fatal error.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJotFormAPIClient

func NewJotFormAPIClient(apiKey string, outputType string, debugMode bool) *jotformAPIClient

Types

This section is empty.

Jump to

Keyboard shortcuts

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