xolphin-go-api is a library which allows quick integration of the Xolphin REST API in Go to automated ordering, issuance and installation of SSL Certificates.
Xolphin is the largest supplier of SSL Certificates and Digital Signatures in the Netherlands. Xolphin has
a professional team providing reliable support and rapid issuance of SSL Certificates at an affordable price from industry leading brands such as Sectigo, GeoTrust, GlobalSign, Thawte and Symantec.
Library can be installed go package manager
go get github.com/xolphin/xolphin-api-go
And updated via
go get -u github.com/xolphin/xolphin-api-go
package main
import (
"github.com/xolphin/xolphin-api-go"
"fmt"
)
func main() {
client := xolphin.NewClient("<username>", "<password>")
fmt.Println(client.BaseURI)
}
requests, err := client.Request().All()
if err != nil {
fmt.Println(err)
}
for _, request := range requests {
fmt.Println(request.Id)
}
request, err := client.Request().Get(1234)
if err != nil {
fmt.Println(err)
}
fmt.Println(request.Embedded.Product.Brand)
ccr := client.Request().Create(24, 1, `<csr_string>`, "EMAIL")
ccr.Address = "Address"
ccr.ApproverRepresentativeFirstName = "FirstName"
ccr.ApproverRepresentativeLastName = "LastName"
ccr.ApproverRepresentativePhone = "+1234567890"
ccr.ApproverRepresentativeEmail = "email@domain.com"
ccr.ApproverRepresentativePosition = "IT"
ccr.ZIPCode = "123456"
ccr.City = "City"
ccr.Company = "Company"
ccr.ApproverEmail = "admin@domain.com"
ccr.SubjectAlternativeNames = append(ccr.SubjectAlternativeNames, "test1.domain.com")
ccr.SubjectAlternativeNames = append(ccr.SubjectAlternativeNames, "test2.domain.com")
ccr.DCV = append(ccr.DCV, xolphin.DCVRequest{Domain: "test1.domain.com", DCVType: "EMAIL", ApproverEmail: "test1@domain.com"})
ccr.DCV = append(ccr.DCV, xolphin.DCVRequest{Domain: "test2.domain.com", DCVType: "EMAIL", ApproverEmail: "test2@domain.com"})
result, err := client.Request().Send(ccr)
if err != nil {
fmt.Println(err)
}
fmt.Println(result.Id)
result, err := client.Request().SendNote(1234, "My message")
if err != nil {
fmt.Println(err)
}
fmt.Println(result)
result, err := client.Request().GetNotes(960002428)
if err != nil {
fmt.Println(err)
}
for _,element := range result {
fmt.Println(element)
}
//currently available languages: en, de, fr, nl
result, err := client.Request().SendComodoSA(1234, "mail@example.com","en")
if err != nil {
fmt.Println(err)
}
fmt.Println(result)
ccr := client.Request().CreateEE()
ccr.CSR = "<csr_string>"
ccr.ApproverRepresentativeFirstName = "FirstName"
ccr.ApproverRepresentativeLastName = "LastName"
ccr.ApproverRepresentativePhone = "+1234567890"
ccr.ApproverRepresentativeEmail = "user@domain.com"
ccr.ApproverRepresentativePosition = "IT"
ccr.ApproverEmail = "admin@domain.com"
ccr.SubjectAlternativeNames = append(ccr.SubjectAlternativeNames, "test1.domain.com")
ccr.SubjectAlternativeNames = append(ccr.SubjectAlternativeNames, "test2.domain.com")
ccr.DCVType = "FILE"
result, err := client.Request().SendEE(ccr)
now := time.Now()
result, err := client.Request().ScheduleValidationCall(1234,now)
Or
callDetails := map[string]string{
"Timezone" : "Europe/Amsterdam",
"Date" : "2024-01-01",
"Time" : "14:00",
"Action" : "ScheduledCallback",
"PhoneNumber" : "132465",
"ExtensionNumber" : "12",
"EmailAddress" : "email@client.com",
"Language" : "en-us",
"Comments" : "",
}
request, err := client.Request().ScheduleValidationCall(1234,callDetails)
where action can be:
"ScheduledCallback" Schedule automatic Callback for customer "ManualCallback" Notify support that customer is requesting manual callback "ReplacePhone" Notify support that current phone number is invalid and suggest a new one, or that the callback method needs to be changed from Email to Telephone. "replaceEmailAddress" Notify support that the callback method needs to be changed from Telephone to Email. "sendCallbackEmail" Request re-sending callback email to customer
certificates, err := client.Certificate().All()
if err != nil {
fmt.Println(err)
}
for _, cert := range certificates {
fmt.Println(cert.Id)
}
crt, err := client.Certificate().Download(1234, "CRT")
if err != nil {
fmt.Println(err)
}
ioutil.WriteFile("crt.crt", crt, 0777)
products, err := client.Support().Products()
if err != nil {
fmt.Println(err)
}
for _, product := range products {
fmt.Println(product.Id, product.Brand, product.Name)
}
dc, err := client.Support().DecodeCSR(csr)
if err != nil {
fmt.Println(err)
}
fmt.Println(dc.Type, dc.Size)