Square API - cash-drawer-shift unauthorized? - square

I've been using the Square v1 API https://connect.squareup.com/v1/{{location_id}}/cash-drawer-shifts/ to get a list of recent cash drawer open/closes. This stopped working last weekend. I now receive a 401- unauthorized error. Has something changed? Is there a similar call in the v2 API?

Related

CoinMarketCapApi get all coins with their logos

I want to display a list of all cryptocurrencies with their logos.
I tried to call CoinMarketCap API to get these informations.
I found this endpoint /v1/cryptocurrency/listings/latest that return all coins but without logos.
https://coinmarketcap.com/api/documentation/v1/#operation/getV1CryptocurrencyListingsLatest
There is another endpoint /v2/cryptocurrency/info that return the logo, but not for all coins.
I should specify a list of coins to get their logos.
https://coinmarketcap.com/api/documentation/v1/#operation/getV2CryptocurrencyInfo
I think that getting all coins from the first endpoint, and pass them as parameters in the second endpoint is not a good idea.
My questions are:
is there another way to get coins with their logo without making two API calls?
is the CoinMarketCap API, the best api to get these informations or I should search for another API?

"No 'Access-Control-Allow-Origin' header" error when making a request to a public API

This is the documentation of the API I'm trying to make a request to.
Relevant section:
Public Data Functions
Ticker
GET https://kiwi-coin.com/api/ticker/
Returns JSON object:
last - last BTC price
date - price date
high - last 24 hours till date price high
low - last 24 hours till date price low
vwap - last 24 hours till date volume weighted average price: vwap
volume - last 24 hours till date volume
bid - highest buy order
ask - lowest sell order
Here's my code:
$.ajax({
type: "GET",
url: "https://kiwi-coin.com/api/ticker/",
});
Yep, there's no way of handling the response. Ignore this for now,
I'm just focusing on getting the request to work.
Here's the error I get in the console:
Failed to load https://kiwi-coin.com/api/ticker/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://cloud-rooster.glitch.me' is therefore not allowed access.
What am I doing wrong? This API works for other users (e.g. bots).
I checked out the other questions with a similar title, but from what I could make out the answers all involved making changes to the server, which isn't an option in this case.
If the API server doesn't support CORS, there are two options:
JSONP. Though you can't make cross-origin XHRs without adequate permission, you CAN include a JavaScript file from anywhere. If the API server returns something like callback({ json data ...}), then you can use the data without having to jump through hoops. However, it doesn't seem like KiwiCoin supports that.
Run your own server from the same origin as your client application (probably the same server that hosts your HTML/JS files), and have endpoints on your server that forward to the API server. This is foolproof.
One thing I noticed from looking at your code is that you have calls to process.env, which doesn't exist in the browser. That might be the sign you need to try option #2!
It turns out I was running the function from the client-side (in the browser), rather than server-side (in a Node.js environment).
Duh!
Problem solved.

Not getting 'Pending' payments in GetSellerPayments for half.com API

Posted this on the eBay API developer forum several weeks ago with no useful answers. I am working with the GetSellerPayments API for half.com. Getting an API response back on "Paid" payments works fine but I am looking to get "Pending" payments as documented here: Half.com API GetSellerPayments API Documentation working as well.
Using API levels 913 thru 933 all same no joy behavior.
Simple request change of XML tag PaymentStatus from Paid to Pending:
<PaymentStatus>Pending</PaymentStatus>
With "Paid" things work fine, with Pending no records found. I have manually verified the seller account does in fact have pending payments at half.com. And I have manually verified the date range for the payment period is correct and works at the half.com website.
Anyone have experience with this specific call on half?
This started working in API level 941

how to display Google Plus average rating on my website?

I want to put Google+ badge of a business on my page. I can get code for it using Google Developer website: https://developers.google.com/+/web/badge/#badge
But i do not understand how to get average score and number of reviews so I can feature them on my website as well - something similar to what you get when you search for a place:
for example, here is a restaurant's Google+ page: https://plus.google.com/106659611775440325701/about?hl=en - it clearly displays all those reviews and scores. How to get this information from Google? Is there a way to modify badge's code to include them?
Reviews data is part of the Places API. There are a couple of options for getting them on your site.
The Maps Embed API would be the easiest but requires loading a map on your page.
Using the Maps JS API v3 you can load and render place details client side.
Using the HTTP API you can load details on your server to cache in a DB and render on page load.
UPDATE May 2019: it is possible now to get total number of reviews using Place Details Place APIs call: https://developers.google.com/places/web-service/details#fields
as of Jan 2019, it returns user_ratings_total field: https://developers.google.com/maps/documentation/javascript/releases#335
so looking at this again 3 years later, we still can't get all reviews for a place. We can get some - top 5 - using Place Details API call: https://developers.google.com/places/web-service/details
then there is a change request for Google team to extend this: https://issuetracker.google.com/issues/35825957
And finally, you can apply for Google Business Account and request access to extended API which allows you to get all reviews for a verified location: accounts.locations.reviews.list

Why do I get the 'Oops' error from Instagram API location search (when using coordinates)?

I'm tring to search locations with the Instagram API in my application but also when testing with Apigee, I get 500 Internal server error, and Oops, an error occurred.
Apigee: https://apigee.com/console/instagram
Authenticate yourself and add this URL: https://api.instagram.com/v1/locations/search?lat=40.758896&lng=-73.985131
It should return Time Square locations. It worked a few times in the past, but currently it doesn't.
It would be an overkill to use the Foursquare api to search for locations, then pass the location id to Instagram. Is that the only way to get around this? Because once you know the location's ID it works ok.
My possible solution would be to let the user find the desired location here: http://worldc.am/id/47383924f964a520444c1fe3
And use the v2 foursquare API location ID for Instagram.
The Instagram API is pretty bad in that regards - it often just says "Oops an error occured!", without giving you any more info.
I believe their servers have a really low time out limit. Add the parameter distance=500, or even less, and you won't get this error any more. Basically, in a high density area (like a big city), you need to specify a small distance number, otherwise Instagram's server just times out while serving your request.