First, I can't seem to get an appropriate response when I pass the payment_id parameter. Here's my code:
- <script>
- $(document).ready(function() {
-
- jQuery.ajax({
- type: "GET",
- url: "https://books.zoho.com/api/v3/customerpayments",
- data:{"authtoken":"XXXXXX", "payment_id":"129449000055550939"},
- dataType: "json",
- success: function (data, status) {
- console.log(data);
- },
- error: function (status) {
- document.write(status)
- }
- });
- });
- </script>
My payment id is correct and for some reason the above brings up a recent set of 200 payments in the response array.
If I pass the date parameter, it works and I can see that particular payment when I search for its associated date.
Next problem:
I have a working GET request that picks up the one payment I want (using date instead of payment_id unfortunately). If I try to set my script to send a request type=DELETE, I get the following:
405 (Method Not Allowed).
- <script>
- $(document).ready(function() {
-
- jQuery.ajax({
- type: "DELETE",
- url: "https://books.zoho.com/api/v3/customerpayments",
- data:{"authtoken":"XXXXXX", "date":"2007-04-09"},
- dataType: "json",
- success: function (data, status) {
- console.log(data);
- },
- error: function (status) {
- document.write(status)
- }
- });
- });
- </script>
Is there some special permission i need to get for my account to use DELETE/PUT? There are DELETE and PUT commands in the API documentation, but there's no mention of special permissions or grants.