BCS API

Suggestions, Problems, Availability, etc. Everything is up for discussion.
Post Reply
ktyacke
Posts: 13
Joined: Tue May 24, 2016 6:57 am
Bot?: No

BCS API

Post 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
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: BCS API

Post 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.
ktyacke
Posts: 13
Joined: Tue May 24, 2016 6:57 am
Bot?: No

Re: BCS API

Post 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
ktyacke
Posts: 13
Joined: Tue May 24, 2016 6:57 am
Bot?: No

Re: BCS API

Post 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 =]
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: BCS API

Post 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.
User avatar
oakbarn
Posts: 846
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: BCS API

Post 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 5113 times
ktyacke
Posts: 13
Joined: Tue May 24, 2016 6:57 am
Bot?: No

Re: BCS API

Post 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
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: BCS API

Post 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.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: BCS API

Post 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.
ktyacke
Posts: 13
Joined: Tue May 24, 2016 6:57 am
Bot?: No

Re: BCS API

Post 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
Post Reply