Hello,
I am trying to test the Retrieve to Client (Restore) API following the document Retrieve to Client (Restore) | Commvault.
I tested the API with both Postman and Golang, and both times I received an error in response. The error is pasted below.
"ClientInfo is not complete","errorCode":9517
Please see the sample GoLang code below. I followed the example in the Commvault rest API docs, but I can't figure out what's missing here.
package main
import (
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"strings"
)
func main() {
url := "https://hostname/commandcenter/api/retrieveToClient"
method := "POST"
payload := strings.NewReader(`{
"mode": 2,
"serviceType": 1,
"userInfo": {
"userGuid": "da752adf-79f0-47d6-8be5-d3dadc9abc5e"
},
"advanced": {
"restoreDataAndACL": true,
"restoreDeletedFiles": true
},
"header": {
"destination": {
"clientId": 171,
"clientName": "<<clientname>>",
"inPlace": false,
"destPath": a
"C://Users//Administrator//Downloads"
]
},
"filePaths": t
"//C://Users//Administrator//Desktop//800gb"
],
"srcContent": {
"subclientId": 399,
"clientId": 171,
"instanceId": 1,
"backupSetId": 331,
"appTypeId": 33
}
}
}`)
client := &http.Client{}
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
req.Header.Add("Authtoken", "QSDK 3b83bf1066977563d72cc4d5de464a5b4602376898a02ae6d0bb71b2203d48c1d76041e15edda9950eeb20242519e7c51a2a33c8a90d6c921d532e1f9b71c104f22fca2b87e0566fb6fa4aa12b6a3eb26036f77470d15f8468ab08ce41ce4b14d8017a898127d930021c4d9e37626fb2f8b025ad070dd3f8e998d0fdc8a0ae2ec865e1879aef4ee20081d6932753a8d9171c04870d64c090d4db4cf5e2696e5d8885d32b3db00d1d489d1774c9d0811aa83f2ec97b4639f64d45de8dc813d7967e5cf7f7304bb314a65920e0cb2b22e545ada376f28de827d65dc20ea48eb0dda3fbef4e598ed68fa")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}