This is a client to interact with the KwikDesk Partner Platform using the Go Language.
The partner documentation can be found at partners.kwikdesk.com.
If you are having issues importing the package, don't forget to run: go get github.com/kwikdesk/kwikdesk-go-client
This package is a barebone straightforward package that allows you to complete the lifecycle of a message on Kwikdesk from token creation to message creation to search and secure channel communications.
When creating a token, we need to pass either an application name or if we wish to be contacted at some point if needs be, an email address.
import "github.com/kwikdesk/kwikdesk-go-client"
client := kwikdesk.NewClient("") // We pass an empty token here.
token, _ := client.CreateToken("MyApplicationName")
Make sure not to loose your token as it is not retrievable for privacy reasons
The Token
API documentation can be found here.
Let's assume our token is token-token-token
.
First we are going to create a message that is searchable (Not private — third parameter).
import "github.com/kwikdesk/kwikdesk-go-client"
client := kwikdesk.NewClient("token-token-token")
message, _ := client.Messages("Content of my message #testing", 1440, false)
fmt.Printf("%v", message)
This created a public message (public but only associated with your account)
Then we want to create a message that will only be retrievable via secure-channels:
import "github.com/kwikdesk/kwikdesk-go-client"
client := kwikdesk.NewClient("token-token-token")
private, _ := client.Messages("Private message. No Hashtags Required.", 1440, true)
fmt.Printf("%v", private)
The Messages
API documentation page can be found here.
Now the search allows you to search for messages associated with your application token and that have the private flag set to false. You can execute a search like this:
import "github.com/kwikdesk/kwikdesk-go-client"
client := kwikdesk.NewClient("token-token-token")
search, _ := client.Search("testing")
fmt.Printf("%v", search)
You can then iterate over the map of interfaces.
The Search
API documentation page can be found here.
Now that you've created messages that can't be searched for, you can only retrieve them by using the channels. All you have to do is:
import "github.com/kwikdesk/kwikdesk-go-client"
client := kwikdesk.NewClient("token-token-token")
channel, _ := client.Channel()
fmt.Printf("%v", channel)
The Channel
API documentation page can be found here.
If you are interested in an example that is fully runnable from A to Z, you can check out the examples/main.go and run it.
It will generate a token, create a searchable message, create a private message, search for the public message, and retrieve the channel messages.
Copyright (c) KwikDesk. All rights reserved. See the LICENSE file.