Detecting if CarrierService API is available - shopify

What is the recommended way of detecting if a store has CarrierService API available? I.e. it's on the right plan or billed annually.
I noticed attempting to retrieve a list of carrier services could work since it's always empty if a shop cannot use the CarrierService API. However, that feels hacky. Apart from that, I can imagine a scenario when this can return empty also for shops with that API available. Is there a better, more reliable way?

The only sure way is to try creating a carrier service. This API call will fail with a specific error message in the response body when the shop doesn't have that feature.

Related

Leaving feedback to a buyer using REST APIs

In the Trading API, it was possible to leave feedback for a buyer with either the CompleteSale or LeaveFeedback calls.
I'm building a new application from scratch and using the newer REST APIs, but was unable to find any reference to feedback in any of them. I would have assumed this would be part of the Fulfillment API, which handles orders and their fulfillment, but apparently the new version of CompleteSale (createShippingFulfillment) no longer supports leaving feedback and there's no call dedicated to leaving feedback as far as I can tell.
Is feedback no longer a thing in the new REST APIs?
LeaveFeedback call works and is fairly simple: tried to give code example but its not allowing me thinks I am trying to inject code :)
Use XML and PHP works fine

Retrieve Steam game data using API request

I'd like to know how to create an API call to the Steam web API in order to retrieve all the relevant data for a specified game. I found an example call that almost does what I need, except this call requires you to know the Steam app ID as you can see below:
http://store.steampowered.com/api/appdetails/?appids=730
As you can see if you click on the link, all the information I need is returned with the API call. However I'd like to know if it's possible to modify this API call so that it returns the required information using the game name rather than the Steam ID number?
Unfortunately I don't think this is possible (although the lack of official documentation of the API means I may be wrong).
Firstly, from a design perspective it probably wouldn't work - games could have the same name and so name is not a unique enough reference to identify an item (which is a fundamental concept of a correctly designed REST API).
Secondly, all examples (such as this here) I have come across on the web of people self-documenting the API use appID to identify a game/software and have found no cases of being able to use name. The other documented Steam DEV APIs also use AppId

Adding Customer records via Liquid?

Basically, I'm looking for the absolute simplest way to add an email (which is effectively a Customer object with no other parameters) to my list of Customers. The use-case is a jQuery-based pop-up email collector that I'm writing because I'm not happy with/don't want to pay for more established solutions.
Everything is working correctly, except I'm stuck on how exactly to authenticate to my Shopify store. Via Javascript I can only perform a few API calls, none of which I need. There are also very complex solutions for creating full-fledged apps for Shopify which are able to do everything, but I think that's overkill for this one API request I need to make.
I know that all I need to do is make a POST request once authenticated per these instructions. What is the best way to do this?
If you want to create user from jQuery you can generate using AJAX POST call in appropriate URL generated using Private App, but be careful before placing authorization details in front end since it will be visible and any one can misuse it.
The better way is to create user using HTTP Post call from some server side language like JAVA or PhP or some language.

Tokbox OpenTok client to call another client

I want to build an application where it is possible for one client to call another client using webRTC. I've started to look into webRTC providers and I've found Toxbox among others.
Is it possible, using TokBox OpenTok, for a client to actually make a call to another client (similar as a regular phone call)? From their docs and specifications it seems that it is only possible to create a "session" (a room in which participants meet and chat).
Am I missing something, or are they only providing sessions that people join/leave?
Twilio seem to offer what I need here,
but I find it strange that I cannot find something similar at Tokbox.
Thanks,
Muff
Yes it is possible.
You need to make the distinction between the type of API the platform exposes to what you can do with it.
While the OpenTok API is built around the concept of a room/session - you can easily use that concept to create a call. There are many openTok developers who do just that.
Twilio indeed offers the same capability - as are many others (a partial list can be found in this report - https://bloggeek.me/webrtc-paas-report/ - while the report is a paid one, the list is available on that page

Get client_id/client_secret From Tesla Motors API

I'm making an app to keep track of things like miles driven, Kwh used, etc. But I'm having a hard time figuring out how to get a client_id and client_secret being that the API is unofficial.
Here's the Apiary with the API details:
http://docs.timdorr.apiary.io/#reference/authentication/tokens/get-an-access-token?console=1
Anyone know how to generate them? or is everyone else that makes an app for an unofficial API just making a random string for those?
The apiary web site tells you to use the following values.
"client_id”: "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384",
"client_secret": "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3",
Another option would be to use the Smartcar's API! The cliend_id and client_secret appear on your dashboard once you sign up (https://smartcar.com), it is very easy to find them. The API also allows you to do other stuff like locking and unlocking the tesla, finding the location, etc.
You can also check the Odometer API endpoint page to learn more about how you can get the miles driven here (https://smartcar.com/product/odometer/).