A Golang wrapper for some common Cvent SOAP API functions.
gosoap gave this wrapper a big head start. There was a lot of hacking on gosoap to make it work with Cvent's API, so you will find it forked and included with gocvent
.
This package includes Golang Structures for the out-of-the-box versions of Contacts, Events, Registrations and Users CvObjects in the definitions/
directory. If you want to work with other CvObjects and/or use custom fields on these structures, you will need to build your own struct
s using cvent.StructGen("filePath", "CvObject")
, then use the resulting struct
s in your Cvent API retrieve calls, e.g.
var objectDef objDefs.EventRetrieveResult
err := cvent.Retrieve("Event", v, &objectDef)
if err != nil {
fmt.Printf("TestRetrieveEvent err from cvent.Retrieve: %s", err)
}
fmt.Printf("Event Title: %s\n", objectDef.CvObject.EventTitle)
Demonstrations of each of the implemented Cvent API methods has at least one corresponding test in gocvent_test.go. Current implementation includes:
- Login
- DescribeCvObject
- DescribeGlobal
- Search (only AndSearch style filtering is currently implemented, see CvSearchObject and
gosoap/encode.go
) - Retrieve (gocvent only supports retrieval of one record at a time, which is different than the Cvent's function which would support several. Pull requests welcomed.)