I'm looking at https://developers.google.com/coordinate/v1/batch to try and find out how to perform batch lookups of Place references.
However, I'm a bit confused with the example post on sending the batch request.
Can someone provide some example code, preferably in Objective-C explaining it a bit better
Thanks!
Try the API clent library. There should be some way to easily batch requests. I know there is for PHP and Python.
That is, if you're actually wanting to use the Coordinate API. If you're trying to use the Places API, you're probably SOL because batching isn't supported as far as I can tell.
Related
I am very interested in Integration Platform as a Service.
As we know, it is possible to generate an API spec from an API. Is the opposite possible?
I want to write a piece of software that automatically create some functions for calling the endpoints of an Open API. In order to achieve that, the piece of software should consume an API spec and generate the code. Theoretically, this could be possible, if the spec covers all endpoints with all parameters of the API, etc. but:
this is often not the case
specs are written differently from each other
My question is: what should my software consume in order to get reliable information about the API endpoints, parameters etc.? Is there a standard for that? Is the API spec the way to go?
Look at Github Copilot. They're able to generate pretty descent facsimiles of functions from API spec. Just a word of caution, the function might not be 100% accurate and so you'll still need to check over it.
In a properly designed webservice there are at least 4 layers, presentation, application, domain and infrastructure.
REST documentation describes only the presentation layer's outer surface: HTTP interface and operations, so it is not possible to generate a complete webservice based on the REST API documentation. If your application does not have any kind of logic, it is just a data structure and CRUD, then it is possible, but in that case you'd better to find a database which has a REST API and very good access control and problem solved mostly.
If you have some sort of standard documentation like WADL or JSON-LD with Hydra, then you can generate a REST API skeleton for the presentation. I just googled the topic a little bit, maybe this thesis can be useful for you: https://repositorio.ul.pt/bitstream/10451/35311/1/ulfc121800_tm_Telmo_Santos.pdf
I am in the process of using VBA in SolidWorks' to integrate Autodesk's PLM 360 into SolidWorks. The problem is that I have very little experience interacting with REST APIs, and it seems like uploading files to a cloud application is probably the most complicated part of that. In any case, it is very important for me to be able to do two things with VBA from SolidWorks: (1) add images to an item's description (documentation), and (2) upload and attach files to an associated item (documentation).
In any case, the PLM 360 documentation explains things fairly clearly, and this blog post (specifically, the approach using WinHttp.WinHttpRequest.5.1) seems to do a decent job of explaining the VBA side, but I'm struggling to figure out which things are important from each of the given examples.
Here are the main things that are puzzling me at the moment:
The PLM 360 documentation seems to indicate that one request is being sent in two parts, but I don't understand how to do that in VBA.
The code in the blog post surrounds the binary file with STR_BOUNDARY. Is that necessary in all cases, or is that something that's necessary only for some APIs?
The code in the blog post includes the Content-Disposition and a few other things in the binary portion. Again, is this necessary in all cases, or is that something that's necessary only for some APIs?
The caveat to the pvToByteArray function is confusing to me. I understand that it is converting back to a byte array the string containing the file data, but if #3 above is not necessary in PLM 360, is it necessary to convert the file to a string and then back to a binary "blob", or does that result in it being possible to pass baBuffer without failure?
How do I include the rest of the information in the request for creating the item? I suppose this is somewhat related to #1 above, but I don't understand how to send API calls in two parts.
Ultimately, I'm posting this question here because I don't think people on the SolidWorks forum would have enough experience with REST APIs to be able to help, and experience shows that the people in the PLM 360 forum don't have enough experience with VBA to be able to help. StackOverflow seems like the place with the best chance of having people with experience in both areas.
I've read through https://github.com/apotonick/roar and it seems like a lot of thought has been put into ROAR. But in the context of a fairly standard Rails-powered JSON API that uses jbuilder, I'm still not able to immediately see what benefits ROAR provides.
What am I missing?
Within a Rails project, you should do as much as possible to stick with the built-in solution, but outside a choice is mandatory. Personally one aspect that I love about ROAR is the versioning for the API.
There is one good post I like that might help you:
http://devblog.reverb.com/post/47197560134/hal-siren-rabl-roar-garner-building-hypermedia
It might not be an straight answer, but it explains the problems you should be aware of when choosing a JSON API generator.
APIs are getting more and more popular and are used by developers to ease the process of developing applications to multiple platforms AND allow them to give other developers the ability to integrate their application's functionality into their own applications.
I've used APIs countless times before, but I'm now at the stage of developing my own applications. And as a developer who strives to create multi-platform applications - I need to use an API.
I'm going to use the RESTful approach as it's recommended the most.
After reading and looking for some background information, I came across: REST API Tutorial (which is really good site!), I learned that APIs basically receive HTTP requests, and return data in JSON/XML format.
However, there were 2 questions left unanswered to me:
In what form do APIs come in? Are APIs actually files? a set of commands......?
How do I actually write APIs? I'm talking about the server-side, data-handling code, and not the application/language-specific code (for sending out HTTP requests etc...)
It'd be great if someone could help me and answer the questions above as I have zero experience with APIs.
Any help is appreciated - much thanks!!
Just a quick from-the-gut answer: They are whatever you want them to be!
Off the top of my head, I would define an API as requiring two main elements:
Some documentation which makes it quite clear how to use the logic your systems prvides
Some way to call those systems. That may be as simple as a web-site that accepts POST-messages, and checks them for certain variables and values in order to perform specific tasks.
In short, it should be entirely up to you. Just make sure you provide simple, clear and acurate documentation.
UPDATE, as an asnwer to the comment below:
That is how I interpret it, and it would seem that Wikipedia is more or less in agreement with me. PHP would be a perfect example: You could for instance create a PHP-file which processes a POST, and instead of outputting html, outputs XML with the resulting data needed. Then a third party app could POST to your PHP application, and receive and process the resulting XML.
Apis come as a response to a http request. It is a plain text response that u can use encoded via json or xml as you described.
There are a plenty of frameworks to help you develop and API.
In Ruby u can use grape or rais-api or even rails itself.
There is a lot more available, but this are the ones im most used to use.
Anyone know if it is possible to submit a sequence of samples to Soundcloud to be compiled as one continuous file?
Even better, can samples be mixed & merged together via the API.
This would be great, but realise it may not be possible.
Just wondering?
Cheers
Mike
No, unfortunately we do not offer such functionality at the moment.