Updating Subscription Custom Field with invokeurl Not Working
I'm trying to follow the API instructions as per this documentation:
- // Copy reference number to the PBX Domain custom field
- params = '{"label":"PBX Domain","value":"string"}';
- response = invokeurl
- [
- url :"https://subscriptions.zoho.com/api/v1/subscriptions/" + subID + "/customfields"
- type :POST
- parameters: params
- connection:"subscriptionsconnection"
- content-type:"application/json"
- ];
However, when I try to execute this, I get back the following (abridged) response:
- {
- "code":0,
- "message":"Custom Fields Updated Successfully.",
- "data":[
- {
- "customfield_id":"240902000017851054",
- "value":"",
- "max_length":255,
- "field_id":"240902000017851054",
- "index":1,
- "label":"PBX Domain",
- }
- ]
- }
As you can see, the value is coming back as empty even though I'm passing the label and a value. What's going on here? Why won't it update with the string value as provided in the json params in the body?
EDIT: I've also tried passing params as follows:
params =
'{"custom_fields":[{"value":"string","label":"PBX
Domain"}]}';
And result is the same (value is not updated and returns empty). Also, I should mention, that field does already have a value in it and it’s being updated. When using the GET method, I can see the value but with POST it does not update and returns empty.
Thanks!