Page 1 of 1

BCS API

Posted: Tue May 24, 2016 7:06 am
by ktyacke
Hey Everyone,
I'm wondering if anyone has done any development using the BCS APIs (Open Interface APIs)? I'm trying to gather any info that might be available about accessing/utilizing these APIs to be consumed from a web application. From what I've read in the docs (http://wiki.embeddedcc.com/index.php/Open_Interface) it seems that the data is exposed by a series of .dat files that live on the BCS. Can anyone explain how the .dat files function and how the request/response process works for getting input data out of the BCS?

My goal is to make these APIs more "web friendly" by building out a REST API using NodeJS. Essentially, this will be a wrapper around the existing .dat file interface that makes the request process a bit more standard and user friendly (i.e. easier to build custom interfaces around).

Any info would be greatly appreciated.

Cheers!

Kyle

Re: BCS API

Posted: Tue May 24, 2016 7:25 am
by JonW
You're looking at the old 3.x stuff. All the 4.x API's are already REST/JSON.

Docs are here: http://www.embeddedcc.com/api-docs/

If you use a host file entry on your machine and set the hostname "bcs" to the IP of your BCS unit, the API docs listed above can be used in an interactive mode to query and write to the BCS.

Re: BCS API

Posted: Tue May 24, 2016 2:21 pm
by ktyacke
That's great news, thanks Jon! Out of curiosity, where are the new docs linked from? I went back to the main edbeddedcc page and clicked through to the "Learn" section which takes me to the wiki, and all I can find regarding APIs on there is the old ones I previously linked. I wasn't able to find the new link you provided listed anywhere else...

Also: Do you know where I can find any additional info on the APIs (how they are written/function from a technical level)?

Thanks,

Kyle

Re: BCS API

Posted: Tue May 24, 2016 2:26 pm
by ktyacke
I found part of the answer to my own question after some more digging. It appears there is new documentation that is linked from in the old wiki (though somewhat buried): http://docs.embeddedcc.com/ I'm not sure why this isn't linked from the main embeddedcc site, but I would suggest it as it could prove useful to other folks as well =]

Re: BCS API

Posted: Tue May 24, 2016 3:06 pm
by JonW
ktyacke wrote:Also: Do you know where I can find any additional info on the APIs (how they are written/function from a technical level)?
Not sure what you're asking for here. Can you be more specific?

In general, the API is how all data is read from and written to the BCS. Even the built in HTML UI uses the API for data access.

Re: BCS API

Posted: Tue May 24, 2016 4:12 pm
by oakbarn
The Old Wiki is 3.x stuff.

The new Help/Documentation is found at http://docs.embeddedcc.
There is a link at the top of the old Wiki to the new Help/Documentation.

You can also quickly access the API by using the built in Help in 4.0

1. Toggle Help
2. Click any ?
3. Click Developer Resouces
4. Click here
API.png
API.png (122.7 KiB) Viewed 5267 times

Re: BCS API

Posted: Wed May 25, 2016 6:00 am
by ktyacke
JonW wrote:Not sure what you're asking for here. Can you be more specific?
Looking for information about how the API is developed/run on the device itself. I'm not terribly familiar with programming microcontrollers and was just curious what went into getting data from the device out through the API.

Thanks,

Kyle

Re: BCS API

Posted: Wed May 25, 2016 8:44 am
by JonW
LOL, you're asking how the BCS does its magic! ;)

In a nutshell, the micro runs an HTTP listener which in turn dispatches HTTP requests to different handlers based on request type (e.g. a file/page request, API request, API POST, etc). For the API requests, the micro maintains arrays of object states and will reply with the proper JSON structure while filling in the elements from the current object values.

Re: BCS API

Posted: Wed May 25, 2016 9:58 am
by brahn
I keep thinking I'm going to respond to this thread, but then I read JonW's response and he's already got it covered.

Like Jon said, the device has a number of data structures for maintaining the internal state of the system and the API just maps those values into the JSON responses.

Re: BCS API

Posted: Wed May 25, 2016 7:25 pm
by ktyacke
JonW wrote:LOL, you're asking how the BCS does its magic!
Sorry Jon, not asking for the secret sauce, just interested in how it all functions. I'm a developer by trade (full-stack Node, Python, etc.) and currently an API Evangelist for Akamai (so my day is filled with APIs), so you could say i have more than a slight interest in how various APIs work. =] Thanks for giving me some insight! Once my BCS shows up I'm hoping to start playing with the APIs more extensively!

Cheers,

Kyle