I am setting up a web service where users can include a dynmically created JS file from our server on their site. It presentes content on the users/clients website through the javascript function document.getElementById().innerHTML().
The script on the client’s side is included by:
<script type="text/javascript" src="http://www.myserver.com/embed/script.js/some,more,parameters">
Users can of course change “some, more, parameters” to specific paremeters that I am explaining on my site.
I called it API Usage, but now I wonder, am I correct using the term “API”. Afaik it mostly describes a request/response where the response is often in JSON/XML format, or SOAP (which really is a protocoll).
I am simply using a html request to a dynamically created JS file, though with certain parameters that response JS source code.
I guess my question is simply: Am I termwise correct of using the term API?
Thanks guys!
I consider that an API. You are providing a customizable web service that site owners do not need to host on their sites. The popular Google Maps API also has a JavaScript file that developers include to get them access to maps that become embedded in their site in a similar way that you’re describing.
If someone does not consider what you are doing an API, it’s more likely they’d call it a widget. Widgets are embeddable bits of HTML and JavaScript that bring content from one site to another.
There are nearly 300 JavaScript APIs, so you aren’t alone:
http://www.programmableweb.com/apis/directory/1?protocol=JavaScript
(Disclosure: I edit ProgrammableWeb)