-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactVerifyCertificate.go
38 lines (31 loc) · 1.03 KB
/
contactVerifyCertificate.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package axcelerate
import (
"encoding/json"
"fmt"
)
type VerifyCertificate struct {
Document struct {
Havefile bool `json:"HAVEFILE"`
Detail struct {
Awardtype string `json:"AWARDTYPE"`
Contactid int `json:"CONTACTID"`
Surname string `json:"SURNAME"`
Enrolid int `json:"ENROLID"`
Issuedby string `json:"ISSUEDBY"`
Activityname string `json:"ACTIVITYNAME"`
Givenname string `json:"GIVENNAME"`
} `json:"DETAIL"`
} `json:"DOCUMENT"`
Result bool `json:"RESULT"`
Msg string `json:"MSG"`
}
// ContactVerifyCertificate Checks the system for a certificate issued by the Client.
func (s *ContactService) ContactVerifyCertificate(certificateID string) (VerifyCertificate, *Response, error) {
var obj VerifyCertificate
resp, err := do(s.client, "GET", Params{parms: map[string]string{}, u: fmt.Sprintf("/contact/enrolment/verifyCertificate/%s", certificateID)}, obj)
if err != nil {
return obj, resp, err
}
err = json.Unmarshal([]byte(resp.Body), &obj)
return obj, resp, err
}