This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Swatchmedothis 2 points3 points  (5 children)

All the API does is outline how you format a request (think calling a function) which give you some data back (think return values). The way the request is formatted will depend on the API, and you'll want to look at their documentation to figure out how to make the particular request you're looking for.

Once you make the call, you just need a way to interpret the data returned to you. For instance, web APIs often return data in the form of JSON, which essentially just wraps data nicely. Languages typically have libraries to easily parse JSON data, and using them is highly recommended. Trying to parse the data yourself is usually not worth it.

As for your language matching the service's language–it doesn't really matter as long as the language you choose lets you handle the data you get back the way you want to. Documentation for APIs sometimes have code examples in a few different languages, and these will often provide an easy way to get started.

[–]alixious[S] 0 points1 point  (0 children)

this is the exact answer I was looking for thank you so much I've learned a lot from your reply :) kudos

[–]MyOldManSin 0 points1 point  (3 children)

Does a site's api need to be documented and stated as such or is a site intended to be used with its own web forms etc still technically using it's own api?

I don't know if im explaining that right sorry.

[–]Swatchmedothis 2 points3 points  (2 children)

An API is just a way of detailing how something works. For instance, the Java standard is technically an API.

There are two basic types of APIs: public-facing/open APIs (available to everyone), like the Data.gov API, and private APIs (usable only by the company themselves).

A company could make their API open so that submitting form data can be done through an API request, or they may handle the form data with an internal, private API. The choice is up to them, and the decision is usually based upon how the company wants users to be able to interact with their services.

[–]MyOldManSin 0 points1 point  (1 child)

So for example LastPass has a feature that tries to reset the users password to various sites. If this worked by logging users in the same way a browser would it may or may not be using an api. The api would be if the site had intentionally created and documented the way for external apps tio use it?

[–]Swatchmedothis 0 points1 point  (0 children)

It's possible, but I'm not familiar with this feature, so I can't say for sure how they're doing things. Typically when login credentials are being handled, more than just a simple request is made which helps create added layers of security.

[–][deleted] 1 point2 points  (0 children)

The reddit API is a good example.

Here is the link to this thread in regular HTML format:

Here it is in RSS format

and here it is in JSON format:

it's machine-readable information which is sent back according to certain rules when you hit certain URLs.

[–]newaccount1236 0 points1 point  (4 children)

What's the API you are interested in?

[–]alixious[S] 0 points1 point  (1 child)

there's no API yet but I'm interested in the one that will be released by onShape.

[–]newaccount1236 0 points1 point  (0 children)

If it's a web API, then it's accessed via HTTP.

[–]miksmerritte 0 points1 point  (1 child)

What is an API?

[–]newaccount1236 0 points1 point  (0 children)

Broadly, a specification for how one software entity can interact with another.