Skip to main content

Imp API Reference

Electric Imp’s imp API provides a set of classes and global objects with which device and agent code may access local hardware and remote cloud functionality. This API augments the Squirrel Standard Library, which provides general programming functionality. For more general information about the Squirrel language, see the Squirrel Programming Guide.

  • Examples of code making use of the imp API can be found in the imp API Cookbook.

The imp API includes the following global, automatically instantiated objects:

Agent-Device-Server Communications

  • agent — A device-only object that enables communication with the paired agent
  • device — An agent-only object that enables communication with the paired device
  • server — An object used to access the Electric Imp impCloud™ servers

imp Hardware Management

* Currently available only on the imp004m with impOS™ 38 and above, and the imp006 with impOS 42 and up.
** Currently available only on the imp005.

Internet Communications

  • http — An agent-only object which wraps HTTP-related functions and request creation
  • httprequest — An agent-only dispatcher for outbound HTTP requests
  • httpresponse — An agent-only response creator for inbound HTTP requests
  • httpstream — An agent-only dispatcher for outbound HTTP streaming
  • ftp — An agent-only object which wraps FTP request creation
  • crypto — An object which provides device-centric encryption functionality

Network Management And Local Networking

Pre-release documentation subject to change

  • imp.net — Network selection, management and information tools
  • interface — A device-side object which represents local network interfaces
  • udpsocket — A device-side object which represents a single UDP (User Datagram Protocol) network socket available on the local network only

Feedback via the forum is welcomed.