The Notecard can perform requests and obtain responses from 3rd Party APIs and
services with the web
API requests.
Caveats When Performing Web Requests:
- The Notecard must be in
continuous
mode and connected to Notehub to perform any of the requests below. - The endpoint to the 3rd party API or service must be configured as a proxy Route in Notehub as a "Proxy for Device Web Requests" type.
For more information on these requirements, see the Web Transactions Guide.
Performs a simple HTTP or HTTPS GET
request against an external endpoint,
and returns the response to the Notecard.
The Notecard can only accept valid JSON in response to a web.get
request.
Full HTML and other types of responses will result in a parse error on the
Notecard.
route
string
Alias for a Proxy Route in Notehub.
name
string (optional)
A web URL endpoint relative to the host configured in the Proxy Route.
Response Members
result
integer
The HTTP Status Code.
body
JSON object
The JSON response body from the external service, if any.
{ "result": 200, "body": { "temp": 75, "humidity": 49} }
Performs a simple HTTP or HTTPS POST
request against an external endpoint,
and returns the response to the Notecard.
route
string
Alias for a Proxy Route in Notehub.
name
string (optional)
A web URL endpoint relative to the host configured in the Proxy Route.
body
string (optional)
The JSON body to send with the request.
Response Members
result
integer
The HTTP Status Code.
body
JSON object
The JSON response body from the external service, if any.
{ "result": 201 }
Performs a simple HTTP or HTTPS PUT
request against an external endpoint,
and returns the response to the Notecard.
route
string
Alias for a Proxy Route in Notehub.
name
string (optional)
A web URL endpoint relative to the host configured in the Proxy Route.
body
string (optional)
The JSON body to send with the request.
Response Members
result
integer
The HTTP Status Code.
body
JSON object
The JSON response body from the external service, if any.
{ "result": 204 }