Set Values
Set custom field values
client.V1.CustomFields.SetValues(ctx, body) error
post/v1/customFields/setValues
Sets one or more custom fields on an instance of a Metronome entity. If a key/value pair passed in this request matches one already set on the entity, its value will be overwritten. Any key/value pairs that exist on the entity that do not match those passed in this request will remain untouched. This endpoint is transactional and will update all key/value pairs or no key/value pairs. Partial updates are not supported. There is a 200 character limit on custom field values.
Parameters
bodyCustomFieldsfieldEntityfieldEntityIDfieldV1CustomFieldSetValuesParams
package main
import (
"context"
"github.com/Metronome-Industries/metronome-go"
"github.com/Metronome-Industries/metronome-go/option"
)
func main() {
client := metronome.NewClient(
option.WithBearerToken("My Bearer Token"),
)
err := client.V1.CustomFields.SetValues(context.TODO(), metronome.V1CustomFieldSetValuesParams{
CustomFields: metronome.F(map[string]string{
"x_account_id": "KyVnHhSBWl7eY2bl",
}),
Entity: metronome.F(metronome.V1CustomFieldSetValuesParamsEntityCustomer),
EntityID: metronome.F("99594816-e8a5-4bca-be21-8d1de0f45120"),
})
if err != nil {
panic(err.Error())
}
}