The doc表示您可以在发送请求时使用cancellation_message
参数/字段。我已尝试过两个网址参数和JSON正文中的字段,但这些参数都没有将响应中的cancellation_message
设置为null
以外的任何内容。
curl -H "authorization":"Basic somelongkeybase64=" -X DELETE https://myapp.chargify.com/subscriptions/17356012.json?cancellation_message=Application%20deleted
curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"cancellation_message":"Application deleted"}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json
我错过了什么吗?
答案 0 :(得分:1)
Chargify支持团队得到了答案。
cancellation_message
应该包含在请求正文中的subscription
中:
{
'subscription': {
'cancellation_message': 'Canceling the subscription via the API'
}
}
因此,工作curl
请求如下所示:
curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"subscription":{"cancellation_message":"Application deleted"}}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json
希望它也可以帮助别人。