patch https://api.securevan.com/v4/codes/
Update editable properties of a Source Code or Tag. This is a JSON Patch endpoint.
The following paths are patchable:
/parentCodeId
/name
/description
/supportedEntities
(add or remove)/supportedEntities/*/isApplicable
/supportedEntities/*/isSearchable
/campaign
/campaign/campaignId
/contactType
/contactType/contactTypeId
/revenueStream
/revenueStream/revenueStreamId
/generalLedgerFund
/generalLedgerFund/generalLedgerFundId
/costCenter
/costCenter/costCenterId
/mailMergeTemplate
/mailMergeTemplate/mailMergeTemplateId
/isSourceCodeApplicable
Example: Change Supported Entities on a Tag
The following changes the supportedEntities
of a Tag. Because we require a test
operation
for every operation performed on an array, it verifies the name
of the supported entity at the given
position in the array. Operations happen sequentially which means that removing Events
at
position 0
pushes the next entity up in the array so it is now 0
. Thus testing it at the
same index twice.
[
{
"value": "Events",
"path": "/supportedentities/0/name",
"op": "test"
},
{
"path": "/supportedentities/0",
"op": "remove"
},
{
"value": "Locations",
"path": "/supportedentities/0/name",
"op": "test"
},
{
"value": {
"Name": "Locations",
"IsSearchable": true,
"IsApplicable": true
},
"path": "/supportedentities/0",
"op": "replace"
},
{
"value": {
"Name": "Contacts",
"IsSearchable": true,
"IsApplicable": false
},
"path": "/supportedentities/-",
"op": "add"
}
]
Example: Change Source Code Metadata
The following changes the metadata of a Source Code. Updating the metadata allows users to track efforts, configure settings and configure availability of Source Codes.
[
{
"value": 68,
"path": "/generalledgerfund/generalledgerfundid",
"op": "add"
},
{
"value": 179,
"path": "/revenuestream/revenuestreamid",
"op": "add"
},
{
"value": 47,
"path": "/costcenter/costcenterid",
"op": "add"
},
{
"value": 337,
"path": "/mailmergetemplate/mailmergetemplateid",
"op": "add"
},
{
"value": 2541,
"path": "/campaign/campaignid",
"op": "add"
},
{
"value": 82,
"path": "/contacttype/contacttypeid",
"op": "add"
}
]