hubtel@1.0.20
This adaptor exports the following from common:
- cursor()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
request
request(method, path, body, options) ⇒ Operation
Make a general HTTP request
| Param | Type | Description |
|---|---|---|
| method | string | HTTP method to use |
| path | string | Path to resource |
| body | object | Object which will be attached to the POST body |
| options | RequestOptions | Optional request options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example
request("POST", "patient", { "name": "Bukayo" });
sendSMS
sendSMS(data, options) ⇒ Operation
Send an SMS
| Param | Type | Description |
|---|---|---|
| data | object | An object with from, to, and content attributes |
| options | RequestOptions | Optional hubtel options |
This operation writes the following keys to state:
| State Key | Description |
|---|---|
| data | the parsed response body |
| response | the response from the HTTP server, including headers, statusCode, body, etc |
| references | an array of all previous data objects used in the Job |
Example
sendSMS({
from: 'OpenFn-Test-01',
to: '233538675309',
content: 'hi there, this is OpenFn using the new Hubtel adaptor',
});