The second issue is definitely a bug as I have checked the code and that is a patch won't do anything with the headers in the payload in other words this bit from the post or the equivalent for the patch is missing
- Code: Select all
// Now do the headers (if any)
if (request.Headers != null)
{
foreach (WebhooksSubscriptionHeader webhooksSubscriptionHeader in request.Headers)
{
string webhooksSubscriptionHeaderRecID = System.Guid.NewGuid().ToString();
Db.ExecuteSql(@"INSERT INTO SY_WebhookSubscriptionRequestHeader (RecID, SY_WebhookSubscription_RecID, Name, Value, ItemNo, LastSavedDateTime)
VALUES (@RecID, @SY_WebhookSubscription_RecID, @Name, @Value, (SELECT COALESCE(MAX(ItemNo), 0) + 1 FROM SY_WebhookSubscriptionRequestHeader WHERE SY_WebhookSubscriptionRequestHeader.SY_WebhookSubscription_RecID = @ItemNo_SY_WebhookSubscription_RecID), SYSUTCDATETIME())",
new
{
RecID = webhooksSubscriptionHeaderRecID,
SY_WebhookSubscription_RecID = newSubscription.RecID,
Name = webhooksSubscriptionHeader.Name,
Value = webhooksSubscriptionHeader.Value,
ItemNo_SY_WebhookSubscription_RecID = newSubscription.RecID
});
SY_WebhookSubscriptionRequestHeader newSubscriptionRequestHeader = Db.SingleById<SY_WebhookSubscriptionRequestHeader>(webhooksSubscriptionHeaderRecID);
RESTAPIPlugin.WebhookSubscriptionRequestHeaders.Add(newSubscriptionRequestHeader);
}
}