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

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
  • amqp — an agent-only object which provides AMQP communications

Feedback via the forum is welcomed.