BitStamp Error:"POST only Endpoint" not recognizing my post request - httpwebrequest

I'm not sure if this question is for SO, first I thought it was a problem from my code, but then I tried Postman and I got the same error response. I'm trying to use Bitstamp API to execute a buy order (or sell, it's the same), but the API returns "POST Only Endpoint", but I'm 100% sure that request.Method = "POST". I've implemented the Account Balance API call which is also POST and everything is fine with it. But for some I can't get the buy/sell API call to work.
Here are some pictures proofing that I'm indeed sending a POST request, after that a picture from POSTMAN. Has someone else got this problem?

In Postman and in your code, the URL miss a '/' at the end.
I've had the same issue. It was fixed by adding a '/' at the end of the URL.

Related

Xero API - response when request has valid and invalid elements

I'm using the Xero API to post multiple invoices to Xero.
This works fine if all the invoices are valid. I get a HTTP 200 response with the GUIDs of the newly created invoices.
However, if one of the invoices has an error I get a BadRequest response with a ValidationException.
I would expect the xero system to work transactionally, and if any of the invoices have a validation error, then none of them would be created. However, what I'm observing is that the valid invoices from my request are still created in the system, even when there is an invalid one present in the request.
The problem is that the response from the Xero API just has the details of the validation error. Nowhere in the response do I get the details of the newly created valid invoices. So I have no way of knowing what the GUIDs of those new invoices are.
Has anyone else experienced a problem like this, and how did they overcome it?
I am reluctant to send the invoices individually as their own guidance recommends posting multiple entities at once to avoid exceeding the rate limits of the API.
By default, the Xero API returns a "summarized" view of your errors when one or more resources in a PUT/POST request are invalid.
If you take a look at the Creating many resources section on this page of our docs you'll see an example of how to turn this off using the query parameter ?SummarizeErrors=false.
Cheers,
Matt

Shopify webhook failing to return a successful response

I have created shopify app in which I have used webhooks for checkout/update. Webhook is working fine but I am getting this error message.
Your webhook for checkouts/update
at https://www.smsblitz.io/smsblitz/abondoned?shop=smsblitz.myshopify.com&user=iman%5Egemconsultinginc.org is
failing to return a successful response.This webhook has been
attempted 23 times. If your webhook continues to fail, it will be
removed and your application will not receive any more notifications.
Please help me to solve this issue.
Thanks
Initially I had the same problems. Following things could be taken care for getting out of the above issue.
Do not wait till you process the data in the notification. Soon after you get the webhook data, send back a 200 ok status code and then go further processing.
Make sure there is no white space before php tag or there is no echo statement available before you send the 200 status code to shopify because that will end up with error - header already sent.
Do not sleep with a timer as shopify wait for a 5 second time window and expect your 200 status code in between that time span.
You can save your processed data/id in a database. Shopify sends a webhook notification around 19(they say but sometimes more in real) times. So, you can try with first check with your database that the webhook notification is already processed by you or not. If processed send a 200 OK immediately.
Webhooks created through API are more reliable than the one created manually through the Shopify admin. (Though shopify claims they treat them same.)
Your webhook is not working fine. It is failing to respond to Shopify. So until you fix that, Shopify is counting the failures and letting you know, that soon, they will just stop that Webhook, and you'll have to recreate it.
To solve the issue, POST a webhook to your endpoint and verify it returns a 200 OK.

Paypal REST API - getting 404 when trying to get webhook event with its HATEOS self url

I experimenting with Paypal REST API and I was stunned into a problem with webhooks.
I trying use the following tactic to verify event data - ensure that HATEOAS link with rel == "self" like https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-6L177801XL962315K-5B870910V53268712 is present, and ensure that this link starts with expected API endpoint (set in web.config) and reloads event data with it, and use it as trusted event data.
But this tactic fails, it results to 404 instead of getting webhook data.
Who else used Paypal REST API webhooks? How you are verify that the event come from trusted event source?
Update
Was able to get more details on messages received. Response body:
Data [{\r\n \"name\": \"INVALID_RESOURCE_ID\",\r\n \"details\": [],\r\n \"message\": \"Resource id is invalid\"\r\n}]
Headers as JSON object: [{\r\n \"PROXY_SERVER_INFO\": [\r\n \"host=slcsbplatformapiserv3002.slc.paypal.com;threadId=370534\"\r\n ],\r\n \"Paypal-Debug-Id\": [\r\n \"e33a2f285d46f\"\r\n ],\r\n \"SERVER_INFO\": [\r\n \"webhooksplatformserv:ppaas_1_2.v1.notifications.webhooks-events.id.GET&CalThreadId=184&TopLevelTxnStartTime=14b4099eb05&Host=slcsbwebhooksplatformserv3002.slc.paypal.com&pid=29135\"\r\n ],\r\n \"Date\": [\r\n \"Sat, 31 Jan 2015 15:26:44 GMT\"\r\n ],\r\n \"Server\": [\r\n \"Apache-Coyote/1.1\"\r\n ]\r\n}]
The hateoas link should return the same payload as the original webhook event. So there seems to be some issue there.
However, if your intention is to validate if the event came from PayPal then the correct way is to validate the signature included in the webhooks header. This link has more details around the security aspects in webhooks.
https://developer.paypal.com/webapps/developer/docs/integration/direct/rest-webhooks-overview/#event-security

YouTube Data Api v3 - subscriptions.list and mine = true

I found following problem.
If user is authorized with youtube and you call subscriptions.list with parameter mine set to true. Then you get a list of subscriptions of authorized user. This works just fine if user has YouTube account linked with g+ page or if user has its own channel on YouTube. But if it is just a normal user without a channel and g+ page then this request returns "subscriberNotFound" error.
Is this a bug or am I doing something wrong?
You need to have a channel to subscribe, so that's normal.
You can read this blog for working with channel ids.
Also please use stackoverflow for only programming issues.
As suggested here, you should file bug reports or features request in public issue tracker.
The call to subscriptions.list can't return a subscriptionNotFound Error. This is an error which only occurs when you try to delete a subscription. Maybe you are calling the wrong method? Take a look at this link for more information on the possible error codes, and details why they occur. For all Error codes look here

Google Buzz return the status if the post submission was success or not?

Hi How can I know the status after the post submission? from my site i have made a google buzz buton when I click on this the defined post will submit to the google buzz url. but I want to know if the post submission was success of failure, because I need to keep a track on that. So that on next time I dont need to show the buzz icon there if I already posted there.
So how will I know it was a success or failure?
http://www.google.com/buzz/post?message=Here's%20Buzz!&url=http://www.google.com/buzz
or
window.open(
"http://www.google.com/buzz/post?" +
"message=Here's%20Buzz!&url=http://www.google.com/buzz",
"_blank",
"resizable=0,scrollbars=0,width=690,height=415"
);
You would need to either make an API call to search for the URL posted or you would need to subscribe to the Buzz Firehose to confirm that the post was created successfully. The widget does not have a callback mechanism.
Alternatively, you could go through the OAuth 2 sequence, and instead of posting via the widget, post via the API. Posting via the API will give you a response back telling you whether it succeeded or not.