Skip to content

Getting started

Requirements

1. Install Service-Now SDK for Go

go get github.com/michaeldcanady/servicenow-sdk-go@latest
go get github.com/michaeldcanady/servicenow-sdk-go@{version}

2. Create a credential

package main

import (
    "github.com/michaeldcanady/servicenow-sdk-go/credentials"
    servicenowsdkgo "github.com/michaeldcanady/servicenow-sdk-go"
)

func main() {
    // instantiates a basic authentication username/password credential but you can use any from the `credentials` submodule or implement your own!
    cred := credentials.NewUsernamePasswordCredential("{username}", "{password}")
    ...
}

3. Create a Service-Now client

    ...
    client := servicenowsdkgo.NewServiceNowClient(cred, "{instance}")
    ...

4. Review specific api documentation

With the client object initialized, implementation of the full capabilities offered by the Service-Now SDK for Go can begin. Refer to apis for details on implementing specific APIs.