This paper proposes an application programming interface (API) for accessing services within the internet of things (IoT) through both REST and SOAP protocols. This API provides methods and procedures to allow its usage for performing IoT control and event monitoring operations. In order to encompass devices diversity, the proposed API introduces a uniform abstraction model that constitutes a common standard view to manage objects. An abstract device services interface is then available instead of device commands, thus providing transparent access to devices capabilities and hiding the physical aspects of provider devices. The API has been designed to ease the remote management of IoT smart objects and was implemented as a module of an existing IoT middleware (UIoT). Experimental evaluation of both protocol implementations yields results showing the REST services with faster response time and lower resources usage than similar SOAP services.