Skip to content

Golang sdk for onfido. Generated from openapi. The fork has upgraded to onfido API v3.4

Notifications You must be signed in to change notification settings

wallester/go-onfido-openapi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for onfido_openapi

The Onfido API is used to submit check requests.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 3.6.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import onfido_openapi "github.com/wallester/go-onfido-openapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value onfido_openapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), onfido_openapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value onfido_openapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), onfido_openapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using onfido_openapi.ContextOperationServerIndices and onfido_openapi.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), onfido_openapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), onfido_openapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.eu.onfido.com/v3.6

Class Method HTTP request Description
DefaultAPI CancelReport Post /reports/{report_id}/cancel This endpoint is for cancelling individual paused reports.
DefaultAPI CompleteTask Post /workflow_runs/{workflow_run_id}/tasks/{task_id}/complete Completes a Send / Receive Data task.
DefaultAPI CreateApplicant Post /applicants Create Applicant
DefaultAPI CreateCheck Post /checks Create a check
DefaultAPI CreateWebhook Post /webhooks Create a webhook
DefaultAPI CreateWorkflowRun Post /workflow_runs Create a Workflow Run.
DefaultAPI DeleteWebhook Delete /webhooks/{webhook_id} Delete a webhook
DefaultAPI DestroyApplicant Delete /applicants/{applicant_id} Delete Applicant
DefaultAPI DownloadCheck Get /checks/{check_id}/download Download a PDF of the check
DefaultAPI DownloadDocument Get /documents/{document_id}/download Download a documents raw data
DefaultAPI DownloadLivePhoto Get /live_photos/{live_photo_id}/download Download live photo
DefaultAPI DownloadLiveVideo Get /live_videos/{live_video_id}/download Download live video
DefaultAPI DownloadLiveVideoFrame Get /live_videos/{live_video_id}/frame Download live video frame
DefaultAPI EditWebhook Put /webhooks/{webhook_id} Edit a webhook
DefaultAPI FindAddresses Get /addresses/pick Search for addresses by postcode
DefaultAPI FindApplicant Get /applicants/{applicant_id} Retrieve Applicant
DefaultAPI FindCheck Get /checks/{check_id} Retrieve a Check
DefaultAPI FindDocument Get /documents/{document_id} A single document can be retrieved by calling this endpoint with the document’s unique identifier.
DefaultAPI FindLivePhoto Get /live_photos/{live_photo_id} Retrieve live photo
DefaultAPI FindLiveVideo Get /live_videos/{live_video_id} Retrieve live video
DefaultAPI FindReport Get /reports/{report_id} A single report can be retrieved using this endpoint with the corresponding unique identifier.
DefaultAPI FindWebhook Get /webhooks/{webhook_id} Retrieve a Webhook
DefaultAPI GenerateSdkToken Post /sdk_token Generate a SDK token
DefaultAPI ListApplicants Get /applicants List Applicants
DefaultAPI ListChecks Get /checks Retrieve Checks
DefaultAPI ListDocuments Get /documents List documents
DefaultAPI ListLivePhotos Get /live_photos List live photos
DefaultAPI ListLiveVideos Get /live_videos List live videos
DefaultAPI ListReports Get /reports All the reports belonging to a particular check can be listed from this endpoint.
DefaultAPI ListTasks Get /workflow_runs/{workflow_run_id}/tasks The tasks of a Workflow can be retrieved by calling this endpoint with the unique identifier of the Workflow Run.
DefaultAPI ListWebhooks Get /webhooks List webhooks
DefaultAPI ListWorkflowRuns Get /workflow_runs List Workflow Runs.
DefaultAPI Ping Get /ping Run a health check on the Onfido API
DefaultAPI RestoreApplicant Post /applicants/{applicant_id}/restore Restore Applicant
DefaultAPI ResumeCheck Post /checks/{check_id}/resume Resume a Check
DefaultAPI ResumeReport Post /reports/{report_id}/resume This endpoint is for resuming individual paused reports.
DefaultAPI RetrieveTask Get /workflow_runs/{workflow_run_id}/tasks/{task_id} A single task can be retrieved by calling this endpoint with the unique identifier of the Task and Workflow Run.
DefaultAPI RetrieveWorkflowRun Get /workflow_runs/{workflow_run_id} A single workflow run can be retrieved by calling this endpoint with the unique identifier of the Workflow Run.
DefaultAPI UpdateApplicant Put /applicants/{applicant_id} Update Applicant
DefaultAPI UploadDocument Post /documents Upload a document
DefaultAPI UploadLivePhoto Post /live_photos Upload live photo

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Token

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		onfido_openapi.ContextAPIKeys,
		map[string]onfido_openapi.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

engineering@onfido.com

About

Golang sdk for onfido. Generated from openapi. The fork has upgraded to onfido API v3.4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 83.6%
  • Makefile 16.4%