Hi
I’m attempting to get the list of contact fields using the client.request.invokeTemplate method on the installation page.
Here is the code I’m calling:
client.request.invokeTemplate("getContactFields",{
context:{
domain: THIS.domain,
api_key: THIS.apikey
}
});
And this is the scheme being called:
"schema":{
"protocol":"https",
"method":"GET",
"host":"<%= context.domain %>",
"path":"/api/v2/contact_fields",
"headers": {
"Authorization": "Basic <%= encode(context.api_key) %>",
"Content-Type": "application/json"
}
}
I’m getting the error “Error in establishing connection” status 502.
I cannot find an explanation for error 502. I’ve tried adding “:X” to the apikey, including and excluding the protocol line in the template.
I’ve also tried passing a base64 encoded version of the apiKey to the template, but got an error message to say invalid datatype.