ESP RainMaker API Definitions for SuperAdmins (1.0.0)
Download OpenAPI specification:Download
The API Defintions for the Rainmaker APIs, which are used by super admin users.
Get the deployment details
This API is used to fetch the deployment details
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Default: false If set to true, It fetches details of newer/Phone user pool |
pre_requisite | boolean Default: false |
Responses
Response samples
- 200
- 400
{- "base_url": "example_base_url",
- "http_base_url": "example_base_url",
- "region": "aws_region",
- "account_id": "aws_account_id",
- "build_info": "example_build_info",
- "mqtt_endpoint": "example_mqtt_endpoint",
- "user_pool_id": "example_user_pool_id",
- "app_client_id": "example_app_client_id",
- "OAuth_issuer": "OAuth issuer url",
- "OAuth_url": "OAuth authorize url",
- "OAuth_deployment": "true or false indicating OAuth deployment",
- "super_admin_user_name": "email of superadmin user",
- "dashboard_url": "RainMaker dashboard url"
}
Updates configuration of Cognito app client
This API is used to configure Cognito app client.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Request Body schema: application/json
The required parameter client_id is the unique id given to user pool client. You can get the client_id from Rainmaker Dashboard.On Rainmaker Dashboard, go to Deployment settings, select Cognito Configuration tab. In Cognito App Client Configurations section, you can get the client_id of all configured user pool clients.
Either providers or callback_urls must be provided in request body.
Providers field is the list of Identity Providers that you want to configure. callback URL indicates where the user is to be redirected after a successful sign-in. If providers or callback_urls is not specified, it will be updated as blank.
client_id required | string |
providers | Array of strings |
callback_urls | Array of strings |
Responses
Request samples
- Payload
{- "client_id": "client_id",
- "providers": [
- "Google",
- "Github"
], - "callback_urls": [
- "callback_url"
]
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Gives details of all configured Cognito app clients
This API lists configured Cognito app clients and gives details of each app client
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Responses
Response samples
- 200
- 400
[- {
- "user_poolid": "us-east-1_AAAAAAA",
- "client_id": "xxx",
- "client_name": "user-pool-client-name",
- "identity_providers": [
- "Google",
- "Github"
], - "callback_urls": [
- "https://callbackurl "
]
}
]
Creates Cognito domain
This API is used to create Cognito domain name. The domain name is domain that hosts the sign-up and sign-in pages for your application.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Request Body schema: application/json
domain_name | string |
Responses
Request samples
- Payload
{- "domain_name": "domain-name"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Fetches Cognito domain
This API is used to get Cognito domain name
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Responses
Response samples
- 200
{- "domain_name": "domain-name"
}
Deletes Cognito domain
This API deletes the cognito domain configured in user account
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Responses
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Configures Identity Providers
This API configures Identity Providers for user authentication.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Request Body schema: application/jsonrequired
Provider Type is required parameter. ClientId, KeyId, TeamId and PrivateKey are required for configuration of SignInWithApple. Client Id and Client Secret are required for configuring Goolge and GitHub identity providers.
provider_type required | string |
team_id required | string |
key_id required | string |
private_key required | string |
client_id required | string |
Responses
Request samples
- Payload
{- "provider_type": "SignInWithApple",
- "team_id": "team_id",
- "key_id": "key_id",
- "private_key": "private_key",
- "client_id": "client_id"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Updates Identity Providers
This API is used to update Identity Providers for user authentication
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Request Body schema: application/jsonrequired
Provider Type is required parameter. ClientId, KeyId, TeamId and PrivateKey are required for configuration of SignInWithApple.Client Id and Client Secret are required for configuring Goolge and GitHub identity providers.Provider name is optional parameter.
provider_type required | string |
team_id required | string |
key_id required | string |
private_key required | string |
client_id required | string |
Responses
Request samples
- Payload
{- "provider_type": "SignInWithApple",
- "team_id": "team_id",
- "key_id": "key_id",
- "private_key": "private_key",
- "client_id": "client_id"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Fetches Configured Identity Providers
This API is used to get all configured Identity Providers
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean Points to userpool which supports mobile and email based authentication |
Responses
Response samples
- 200
- 400
null
Updates Message Template
This API is used to customize Email messages sent to users. For example, to customize Email message which has verification code for user verification, template type is INVITE_MESSAGE.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_mobile_userpool | boolean If set to true, It fetches details of newer/Phone user pool |
Request Body schema: application/jsonrequired
For EMAIL templates Message Type, Message Subject, Message Text, Template Type are required parameters. If from Email Address is not specified for INVITE_MESSAGE, invitation mail is sent from AWS Cognito Service.
For SMS templates Message Type, Message Text, Template Type are required parameters. If the sender id is not specified, default sender id from cognito is used.
Valid template types are INVITE_MESSAGE, WELCOME_MESSAGE_ADMIN, DELETE_USER_REQUEST_MESSAGE,FORGOT_PASSWORD_MESSAGE, DELETE_USER_CONFIRM_MESSAGE, TAGS_ASSIGNMENT_VERIFICATION_MESSAGE and SMS_DELETE_USER_REQUEST_MESSAGE
Message Text must have {####} placeholder for verification code.
Message Text must have {{enter_email}} placeholder for User email.
Message Text can optionally have {{assigned_tags}} placeholder for adding the assigned tags to the email for TAGS_ASSIGNMENT_VERIFICATION_MESSAGE template type only.
message_subject required | string Email Message Subject |
message_text required | string Email Message Text |
template_type required | string Enum: "INVITE_MESSAGE" "WELCOME_MESSAGE_ADMIN" "WELCOME_MESSAGE_USER" "DELETE_USER_REQUEST_MESSAGE" "FORGOT_PASSWORD_MESSAGE" "SMS_DELETE_USER_REQUEST_MESSAGE" Message template type |
from_email_address | string User Email Address |
from_user_name | string User Name |
Responses
Request samples
- Payload
{- "message_subject": "Email Message Subject",
- "message_text": "Email Message Text",
- "template_type": "INVITE_MESSAGE",
- "from_email_address": "User Email Address",
- "from_user_name": "User Name"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Fetches Message Templates
This API is used to get list of stored Message Templates. Message templates are the templates used for email messages sent to users.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
template_type | string Enum: "INVITE_MESSAGE" "WELCOME_MESSAGE_ADMIN" "WELCOME_MESSAGE_USER" "DELETE_USER_REQUEST_MESSAGE" "FORGOT_PASSWORD_MESSAGE" "SMS_DELETE_USER_REQUEST_MESSAGE" Template Type |
Responses
Response samples
- 200
- 400
[- {
- "message_subject": "Email Message Subject",
- "message_text": "Email Message Text",
- "template_type": "INVITE_MESSAGE",
- "from_email_address": "User Email Address",
- "from_user_name": "User Name"
}
]
Fetches list of SES verified Email IDs
This API is used to get list of SES Verified Email IDs in AWS account
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
{- "verified_email": [
- "verified-email-address"
]
}
Updates dashboard to latest version
This API is used to update Rainmaker dashboard to the latest version.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
'version' is required parameter.
version | string |
Responses
Request samples
- Payload
{- "version": "current_dashboard_version"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Check available updates for dashboard
This API is used to check updates for dashboard
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
current_version required | string |
Responses
Response samples
- 200
- 400
- 500
{- "version": "latest_version"
}
API for the super admin user to upload customer license
This API is used by customer's super admin users to upload license file to their Rainmaker environment.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
Request body for uploading base64 license file content to customer's Rainmaker environment
file_content_b64 | string |
Responses
Request samples
- Payload
{- "file_content_b64": "file_content_b64"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
API for the super admin user to get uploaded customer license file details
This API is used by customer's super admin users to get customer license file details which are uploaded in the Customer's Rainmaker account.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 500
{- "status": "success",
- "license_files": [
- {
- "file_name": "file_name",
- "date_modified": "date_modified"
}
]
}
API for the super admin user to get the current available license quota
This API is used by customer's super admin users to get the current available license quota.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 500
{- "license_quota": "1000000",
- "available_quota": 899749,
- "used_quota": 100251
}
Node Registration service will be used by the ESP Rainmaker customers to generate the bulk credentials for the nodes.
Generates required number of node_ids for the user
This API sends a request to generate the required number of node_ids. If the user doesn’t have sufficient quota, an error will be returned, else a request_id will be returned.
Authorizations:
Request Body schema: application/jsonrequired
Request body to generate node_ids for user
node_count | number |
Responses
Request samples
- Payload
{- "node_count": 0
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "request_id": "string"
}
Get the status of generate node_ids request
This API is used to query the status of the generate node_ids request. This API takes request_id as query parameter and returns response containing status of the request and a url for the file containing the node_ids if status is success
Authorizations:
query Parameters
request_id required | string RequestId for generating the required number of node_ids |
Responses
Response samples
- 200
- 400
{- "status": "success",
- "url": "string"
}
Get certificate registration requests, for which certificate registration is in progress.
This API is to get the certificate files
- This API is used to fetch list of last 10 requests made that are in_progress when no query parameter is passed
- If the file_name and request_id is specified certificate file pre-signed download URL is returned (Validity 1hr).
- If the file_list is set to true then list of certificate files that were uploaded will be sent.
- We will send the file path after the constant path which is /users/
/node_certificates/. To support pagination num_records and start_id are present
Authorizations:
query Parameters
file_name | string Optional. Name of the file, for which pre-signed download URL is to be fetched. |
file_list | boolean Default: false Optional flag (true/false), to indicate if the list of uploaded certificate files need to be returned. Default (false) |
num_records | string Optional. Sets the maximum number of keys returned in the response. Default 10 |
start_id | string Optional. Used for pagination. |
Responses
Response samples
- 200
- 400
[- {
- "status": "in_progress",
- "request_id": "string",
- "file_name": "file.ext",
- "request_timestamp": 1609331995,
- "completed_count": 1234,
- "total_count": 100000
}
]
Get Pre-signed url or status of the node certificate registration request
This API is used to fetch presigned url or status of the node certificate registration request.
Authorizations:
query Parameters
file_name | string Name of the file, for which upload pre-signed URL is to be fetched. |
request_id | string request_id of the existing request to upload/register certificate |
Responses
Response samples
- 200
- 400
{- "url": "pre_signed_url_of_file",
- "status": "success"
}
Triggers the registration of node certificates.
After the user uploads the .csv file containing the node certificates to s3 bucket this api will be called. It is expected that the user will upload the file containing node certificates separately using CLI/other tool. This API triggers the registration of node certificates and returns the RequestId.
Filename, file MD5 and request ID(which will be provided in the GET {{url}}/v1/admin/node_certificates/register?file_name=node_certs.csv) are required request parameters while Type, Model, group_name , parent_group_id, subtype, tags, force, update_nodes and refresh_token are optional request parameters.
Tags should be provided in the form of comma separated node tags e.g: tag1:value1,tag2:value2
When group name is provided then nodes registered will be added to the given group.
If group name is not provided then nodes are added to a new node group, the group name would be as below:
Either parent groupname or parent groupID can be provided.If both are provided, parent groupid will get precedence.
If the refresh token is not provided then the nodes would not be added to the group.
Authorizations:
Request Body schema: application/jsonrequired
Request body to upload certificate files
file_name | string |
file_md5 | string |
request_id | string |
type | string |
model | string |
group_name | string |
refresh_token | string |
parent_group_name | string |
parent_group_id | string |
subtype | string |
tags | string |
force | boolean |
update_nodes | boolean |
Responses
Request samples
- Payload
{- "file_name": "file_name",
- "file_md5": "file_md5",
- "request_id": "job_request_id",
- "type": "device_type",
- "model": "device_model",
- "group_name": "Node_light",
- "refresh_token": "string",
- "parent_group_name": "parent_group_name",
- "parent_group_id": "parent_group_id",
- "subtype": "subtype",
- "tags": "tag1:value1,tag2:value2",
- "force": true,
- "update_nodes": true
}
Response samples
- 200
- 400
- 500
{- "file_name": "node_certs.csv",
- "file_md5": "18116d4ae069ab2c3e8407b526df4924",
- "request_id": "<job_request_id>",
- "type": "LightBulb",
- "model": "LED1.1",
- "group_name": "test_group",
- "refresh_token": "<refresh_token>",
- "parent_group_id": "<parent_group_id>",
- "parent_group_name": "<parent_group_name>",
- "subtype": "bulb",
- "tags": "tag1:value1,tag2:value2",
- "force": true,
- "update_nodes": true
}
Updates the super admin of rainmaker deployment
This API updates the super admin of rainmaker deployment. This API assumes that the new super admin user doesn't exist in this RainMaker deployment.
Note: When the super admin is changed, please send an update about the same to esp-rainmaker-support@espressif.com to ease the management of RainMaker.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating super admin username
new_super_admin required | string New Super Admin's Valid email address |
Responses
Request samples
- Payload
{- "new_super_admin": "user@domain.com"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Updates the sender email of rainmaker deployment
This API updates the sender email of rainmaker deployment.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating sender email
new_sender_email required | string New sender email address |
Responses
Request samples
- Payload
{- "new_sender_mail": "example@domain.com"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Adds or Updates the common custom data
This API Adds or Updates the common custom data.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for adding or updating common custom data. This will be a JSON payload. The maximum storage allowed for each name is 300KB(after payload is trimmed of space and newline characters). It will have fields: name and value. The name should be a string and value can be any of: JSON, string, int, boolean, array of Json objects.When data is an array of objects, user should specify the entire object for modifying the data.When data is json object, user can perform operations similar to user custom data.The common custom data can be empty or it can have some data as shown below:
{
"name": "faults",
"value": [
{
"device_type": "ac",
"country": "India",
"error_codes": [
{
"code": "E1",
"description": "Error E1 Description",
"additional_field": "AdditionalFieldValue1"
},
{
"code": "E2",
"description": "Error E2 Description",
"additional_field": "AdditionalFieldValue2"
}
]
},
{
"device_type": "refrigerator",
"country": "Australia",
"error_codes": [
{
"code": "P1",
"description": "Error P1 Description",
"additional_field": "AdditionalFieldValue1"
},
{
"code": "P2",
"description": "Error P2 Description",
"additional_field": "AdditionalFieldValue2"
}
]
}
]
}
name | string |
Array of objects |
Responses
Request samples
- Payload
{- "name": "ac_faults",
- "value": {
- "err_code": 10211,
- "disp_code": "None",
- "description": "AC fault error happening"
}, - "perms": [
- {
- "read": [
- "user",
- "admin"
]
}, - {
- "write": [
- "admin"
]
}
]
}
Response samples
- 200
- 400
- 404
- 500
{- "status": "success",
- "description": "Success description"
}
Fetches the common custom data
This API fetches common custom data
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
name | string Name of common custom data to be fetched |
Responses
Response samples
- 200
- 400
- 500
[- {
- "name": "faults",
- "value": [
- {
- "device_type": "ac",
- "country": "India",
- "error_codes": [
- {
- "code": "E1",
- "description": "Error E1 Description",
- "additional_field": "AdditionalFieldValue1"
}, - {
- "code": "E2",
- "description": "Error E2 Description",
- "additional_field": "AdditionalFieldValue2"
}
]
}, - {
- "device_type": "refrigerator",
- "country": "Australia",
- "error_codes": [
- {
- "code": "P1",
- "description": "Error P1 Description",
- "additional_field": "AdditionalFieldValue1"
}, - {
- "code": "P2",
- "description": "Error P2 Description",
- "additional_field": "AdditionalFieldValue2"
}
]
}
]
}, - {
- "name": "warnings",
- "value": [
- {
- "device_type": "tv",
- "country": "Canada",
- "error_codes": [
- {
- "code": "E1",
- "description": "Error E1 Description",
- "additional_field": "AdditionalFieldValue1"
}
]
}, - {
- "device_type": "speaker",
- "country": "Brazil",
- "error_codes": [
- {
- "code": "P1",
- "description": "Error P1 Description",
- "additional_field": "AdditionalFieldValue1"
}, - {
- "code": "P2",
- "description": "Error P2 Description",
- "additional_field": "AdditionalFieldValue2"
}
]
}
]
}
]
API for the super admin user to get service's stored configuration details.
This API is used by customer's super admin users to get service's stored configuration details. Can be used to get configurations for building mobile apps.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
service required | string Enum: "cognito_appclient" "rbac" "encryption" "user_archival" "node_apis" "custom_user_context" "location_trigger" "mobile_app" "OAuth_only" "custom_sms" Service whose configuration is to be fetched. |
query Parameters
platform | string Enum: "ios" "android" If service is mobile_app then platform is required |
package_name | string Example: package_name=com.package.name If service is mobile_app, package name of the Application is Mandatory |
isEmailUserPool | string Default: false If service is mobile_app, use true for older/email-only userPool or false for newer/email-and-phone userPool. Default is Newer userpool. |
Responses
Response samples
- 200
- 400
- 500
{- "user_poolid": "user_poolid",
- "client_id": "client_id",
- "client_name": "client_name",
- "identity_providers": [
- "GitHub",
- "Google"
], - "callback_urls": [
- "callback_url1",
- "callback_url2"
]
}
API for the super admin user to backup service's configuration
This API is used by customer's super admin users to backup service's configuration.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
service required | string Value: "cognito_appclient" Service |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
API for the super admin user to restore service's configuration
This API is used by customer's super admin users to restore service's configuration.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
service required | string Value: "cognito_appclient" Service |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
API for the super admin user to configure service's configuration
This API is used by customer's super admin users to configure service's configuration.
RBAC: API level fine grained access for admins. Can create policies, roles and assign to specific admins.
Node APIs: Nodes can use HTTP instead of MQTT to communicate with Cloud. Currently, supports just OTA operations.
Encryption: Encrypts sensitive fields of Users like email, phone number, username, etc. Cannot be disable once enabled
Role-based Access Control: Use RBAC(Role-based Access Control) to enable fine-grained access evaluation for users. If RBAC is disabled, flag-based approach is used to check user access to operations, as opposed to user roles and policies approach used by RBAC. RBAC can be enabled/disabled with this API.
User Archival: Enables the archival service which warns year old inactive users that their data might be deleted. Deletes that User after 3 months of cooldown.
Custom user context: custom_auth_userid will be able carry out user operations on behalf of others by providing user identifier in the 'Custom-UserId' header
OAuth only (Beta): Use OAuth for identity management instead of Cognito. Currently, only third party logins supported. This is strictly to be enabled before phone apps are live. Please consult the RainMaker support team for more details.
Command Response History: Enables/disables the command response history.
Node Data Access: Enables/disables "read" or "write" access to node data like params and config.
Custom SMS: Sets the Sender ID, Entity ID, Template ID and Country to send Custom SMS to users via registered Sender ID. Country code from the phone number is used to get details of the country while sending SMS.
Location Triggers: The default polling interval is 30 minutes. The default host url is 'https://api.openweathermap.org/data/2.5/weather?units=metric' with default units as 'metric'. The supported units are 'standard', 'metric', 'imperial'. List of all parameters and supported units:
Parameter | Description | Standard | Metric | Imperial |
---|---|---|---|---|
o temperature | Temperature | Kelvin | Celsius | Fahrenheit |
o pressure | Atmospheric Pressure | hPa | hPa | hPa |
o humidity | Humidity | % | % | % |
o wind_speed | Wind Speed | meter/sec | meter/sec | miles/hour |
o weather_condition | Weather Condition | check note | check note | check note |
Note: The supported weather conditions are 'Thunderstorm', 'Drizzle', 'Rain', 'Snow', 'Clear', 'Clouds', 'Mist', 'Smoke', 'Haze', 'Dust', 'Fog', 'Sand', 'Ash', 'Squall', 'Tornado'
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
service required | string Enum: "rbac" "node_apis" "custom_user_context" "location_trigger" "encryption" "user_archival" "OAuth_only" "cmd_resp_history" "custom_sms" "node_data_access" Service to configure. |
Request Body schema: application/json
Request body for configuring a Service
rbac_enabled | boolean Indicates whether Role Based Access Control is to be enabled or not |
allow_same_role_level | boolean Determines if two users with the same role level value can be assigned a role to each other. |
Responses
Request samples
- Payload
{- "rbac_enabled": true
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Successfully configured"
}
Configure IoT Device metrics limit
This API is used to configure various limits in IoT devices security metrics. The supported metrics are:
1.Number of authrorization failures
2.Number of connection attempts
3.Number of Messages sent.
All the metrics count are measured in 5 minutes time period. If the device metrics value is higher than the maximum allowed values, alarm is triggered and mail is sent to configured email ID
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
num_messages_sent, num_authorization_failures, num_connection_attempts are the values that can be specified in the request body.
num_messages_sent | number >= 1 Number of messages sent by a device to IoT core |
num_authorization_failures | number >= 1 Number of times a device's request is declined by IoT Core. For E.g It publishes to a topic it is not authorized to |
num_connection_attempts | number >= 1 Number of times a device connects to IoT core (both successful and failed connections) |
Responses
Request samples
- Payload
{- "num_messages_sent": 100,
- "num_authorization_failures": 1,
- "num_connection_attempts": 25
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Get IoT Device metrics limit
This API is used to get the value of configured limits in IoT devices security metrics. the value indicates the number of allowed operations in 5 minutes period.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 500
{- "num_messages_sent": 100,
- "num_authorization_failures": 1,
- "num_connection_attempts": 25
}
Update API requests rate limit
This API is used to update the API requests rate limit for RainMaker APIs.
The rate limit is the maximum number of requests from a single IP address that are allowed in a five-minutes period. Requests will be blocked once this limit is reached. The requests from an IP address are automatically unblocked after the request rate falls below the limit.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
rate_limit | integer |
Responses
Request samples
- Payload
{- "rate_limit": 1000
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Fetches the configured API requests rate limit
This API is used to get the API requests rate limit, i.e, the threshold count of API requests per 5 minutes period, after which API requests will be blocked.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "rate_limit": 1000
}
Create custom mobile platform message template
This API will be used to create custom mobile platform message template.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for creating custom mobile message template.The message title can have a maximum of 50 characters and message body can have maximum of 1500 characters.
Event Data : When event data is enabled, Event's raw data is shared with mobile.
Event Type : Event topic name.[same as SNS topic name]
Custom messages for the events which are enabled for mobile push notifications should have number of '%s' depending on the event types. Default events should have '%s' which will get substituted by device ID.Specific event types will be mentioned in the below list.Supported event topics:
event_type | string RainMaker Event type |
message_body | string <= 1500 characters Custom message body |
event_data | string Enum: "enable" "disable" Indicates whether to enable or disable event data |
Responses
Request samples
- Payload
{- "event_type": "<esp_rainmaker_sns_node_disconnected>",
- "message_title": "<message title>",
- "message_body": "<message body>",
- "event_data": "<enable/disable>"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
This API fetches configured custom mobile message template
This API fetches configured custom mobile message template.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
event_type | string event type |
Responses
Response samples
- 200
- 400
- 500
{- "common_custom_title": "Esp Rainmaker",
- "custom_message_templates": [
- {
- "event_type": "esp_rainmaker_sns_node_connected",
- "message_body": "Message body",
- "event_data": "enable/disable"
}
]
}
This API updates the configured custom mobile message template.
This API updates the configured custom mobile message template.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
event_type | string event type (Updating message title, doesn't require event_type) |
Request Body schema: application/jsonrequired
Request body for updating custom mobile mesage template.The message title can have a maximum of 50 characters and message body can have maximum of 1500 characters.
event_type | string RainMaker Event type |
message_body | string <= 1500 characters Custom message body |
event_data | string Enum: "enable" "disable" Indicates whether to enable or disable event data |
Responses
Request samples
- Payload
{- "message_body": "<message body>",
- "event_data": "<enable/disable>"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Creates the new platform application
This API creates a new mobile platform application
Platform : Represents a push notification service from a provider like Google, Amazon or Microsoft.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for creating new platform application, Valid platform to be specified are ADM,APNS,APNS_SANDBOX or GCM.
platform required | string Specify GCM as platform for Android that your app is registered with. |
name | string [ 2 .. 256 ] characters ^[a-zA-Z0-9_.-]+$ Unique name of the platform |
api_key required | string Provide Google API Key |
Responses
Request samples
- Payload
{- "platform": "GCM",
- "name": "name",
- "api_key": "<server api key>"
}
Response samples
- 201
- 400
- 500
{- "status": "success",
- "platform_application_arn": "platform application arn"
}
Updates the platform application
This API updates mobile platform application
Platform : Represents a push notification service from a provider like Google, Amazon or Microsoft.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating new platform application, Valid platform to be specified are ADM,APNS,APNS_SANDBOX or GCM.
platform required | string Specify GCM as platform for Android that your app is registered with. |
name | string [ 2 .. 256 ] characters ^[a-zA-Z0-9_.-]+$ Unique name of the platform |
api_key required | string Provide Google API Key |
Responses
Request samples
- Payload
{- "platform": "GCM",
- "name": "name",
- "api_key": "<server api key>"
}
Response samples
- 201
- 400
- 500
{- "status": "success",
- "platform_application_arn": "platform application arn"
}
This API fetches the list of configured platform applications
This API fetches configured platform application
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 500
{- "platform_applications": [
- {
- "platform_application_arn": "platform application arn",
- "Attributes": {
- "AppleCertificateExpirationDate": "2023-03-12T07:19:33Z",
- "AuthenticationMethod": "Certificate",
- "Enabled": "true"
}, - "name": "platform application name",
- "platform": "platform"
}
]
}
This API removes the configured platform application.
This API removes the configured platform application.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
platform_application_arn required | string platform application arn |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Publish message to user's device
This API will be used to publish messages to user's device in a bulk of 100000 users.
If the users wants to publish the message to specific users, at least one of email or user_id list needs to be provided. user_id has more preference over email.
If the users wants to publish to all non-internal users then only the publish_to_all_users should be set to true, without any fields - email and user_id
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for publish message.The message title can have a maximum of 50 characters and message body can have maximum of 1500 characters. The message type and additonal_info are optional parameters. The message type can have a maximum of 25 characters and the additional info can have a total of 1400 characters with each key not excedding 50 characters and each value not excedding 150 characters.
message_title | string <= 50 characters Message title |
message_body | string <= 1500 characters Message body |
string user email addresses separated by commas | |
user_id | string userId separated by commas |
type | string <= 25 characters Type of message |
additional_info | object <= 1400 characters Additional Info |
Responses
Request samples
- Payload
{- "message_title": "<message title>",
- "message_body": "<message body>",
- "email": "email_id1@domain.com,email_id1@domain.com",
- "user_id": "user_id1,user_id2",
- "type": "ADVERTISEMENT",
- "additional_info": {
- "key_1": "value_1",
- "key_2": "value_2"
}
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
External API Pass Through Service will be used by the ESP Rainmaker customers to call external APIs.
Fetches external API configurations
This API is used to fetch configurations of external API. To retrieve a specific service, provide a service ID or to obtain a list, provide the starting characters of the service name.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
service_id | string This parameter is used to specify the service id. |
service_name | string This parameter is used to fetch service list based on starting of service name |
start_id | string This parameter is used for pagination. |
num_records | string Default: 30 This parameter is used to specify number of records. Max Value = 30 |
Responses
Response samples
- 200
- 400
- 500
{- "next_id": "string",
- "api_config_list": [
- {
- "service_id": "string",
- "service_name": "string",
- "updated_at": 0,
- "created_at": 0,
- "api_url": "string",
- "storage_type": "string",
- "auth_type": "string",
- "api_key": "string",
- "auth_token": "string",
- "auth_meta_data": {
- "auth_send_medium": "string",
- "auth_field_name": "string"
}, - "api_config_login_info": {
- "login_api_url": "string",
- "login_type": "string",
- "login_cred_send_medium": "string",
- "login_credentials": "string",
- "login_cred_validation_time": "string",
- "auth_field_name_in_resp": "string"
}
}
]
}
Saves external API configurations
This API is used to save new configurations for external APIs. It will return a unique ID generated by Rainmaker for each external service, called service_id. This service_id is used to call the GET /passthrough API.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
service_name required | string This field is used to specify the service name.Service name should be unique. |
api_url required | string This field is used to specify the api endpoint url of external api. |
storage_type | string This field is used to specify the storage type. All other configurations are stored in DynamoDB, while sensitive information such as auth token or API key is saved according to the specified storage type. Currently, DynamoDB is the only supported storage type. |
auth_type required | string This field is used to specify the authorization behaviour of external API. |
api_key | string Static api key used for authorization of external api. Provide this field only if the auth_type is api_key. |
auth_token | string Static auth token used for authorization of external api. Provide this field only if the auth_type is static_auth_token. |
auth_send_medium | string The medium through which the external API accepts authorization information. |
auth_field_name | string The name of the field when sending authorization information.For Ex While sending an auth token through the HTTP header, the auth_field_name could be 'Authorization' or 'authorization'. |
login_api_url | string This field is used to specify the api endpoint url of login api. |
login_api_request_type | string Default: "POST" This field is used to specify the Http request type of login API. |
login_cred_send_medium | string Default: "body" The medium through which the login API accepts credentials. |
login_credentials | string Key and value pair of credentials in Json string format. |
login_cred_validation_time | string Authentication token validity duration, measured in seconds. |
auth_field_name_in_resp | string The field name that contains the authentication token in the login API response. For example, if the login API response looks like this {"auth_token":"XXX"}, then the auth_field_name_in_resp is 'auth_token'. |
auth_prefix | string Prefix to be attached to the authentication token received from the login API before sending it through another API. |
Responses
Request samples
- Payload
{- "service_name": "OpenWeather",
- "storage_type": "dynamodb",
- "auth_type": "api_key",
- "api_key": null,
- "auth_token": null,
- "auth_send_medium": "query_param",
- "auth_field_name": "Authorization",
- "login_api_request_type": "POST",
- "login_cred_send_medium": "body",
- "login_credentials": "{\"user_name\":\"abc@gmail.com\",\"password\":\"1234\"}",
- "login_cred_validation_time": 1800,
- "auth_field_name_in_resp": "authtoken",
- "auth_prefix": "string"
}
Response samples
- 200
- 400
- 500
{- "service_id": "string",
- "service_name": "string",
- "status": "string"
}
Updates external API configurations
This API is used to update configurations for external APIs.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
service_id | string This parameter is used to specify the service id. |
Request Body schema: application/jsonrequired
service_name | string This field is used to specify the service name.Service name should be unique. |
api_url | string This field is used to specify the api endpoint url of external api. |
auth_type | string This field is used to specify the authorization behaviour of external API. |
api_key | string Static api key used for authorization of external api. Provide this field only if the auth_type is api_key. |
auth_token | string Static auth token used for authorization of external api. Provide this field only if the auth_type is static_auth_token. |
auth_send_medium | string The medium through which the external API accepts authorization information. |
auth_field_name | string The name of the field when sending authorization information.For Ex While sending an auth token through the HTTP header, the auth_field_name could be 'Authorization' or 'authorization'. |
login_api_url | string This field is used to specify the api endpoint url of login api. |
login_api_request_type | string Default: "POST" This field is used to specify the Http request type of login API. |
login_cred_send_medium | string Default: "body" The medium through which the login API accepts credentials. |
login_credentials | string Key and value pair of credentials in Json string format. |
login_cred_validation_time | string Authentication token validity duration, measured in seconds. |
auth_field_name_in_resp | string The field name that contains the authentication token in the login API response. For example, if the login API response looks like this {"auth_token":"XXX"}, then the auth_field_name_in_resp is 'auth_token'. |
auth_prefix | string Prefix to be attached to the authentication token received from the login API before sending it through another API. |
Responses
Request samples
- Payload
{- "service_name": "OpenWeather",
- "auth_type": "api_key",
- "api_key": "string",
- "auth_token": "string",
- "auth_send_medium": "query_param",
- "auth_field_name": "Authorization",
- "login_api_request_type": "POST",
- "login_cred_send_medium": "body",
- "login_credentials": "{\"user_name\":\"abc@gmail.com\",\"password\":\"1234\"}",
- "login_cred_validation_time": 1600,
- "auth_field_name_in_resp": "authtoken",
- "auth_prefix": "string"
}
Response samples
- 200
- 400
- 500
{- "service_id": "string",
- "status": "string"
}
Creates the new user in user email mobile user pool
This API creates a new user in user email mobile user pool. Only Email is supported as user name. Here the role is disjoint of the flags the user need to explicitly assign the required role.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for creating new user
user_name required | string Valid email address or valid phone number |
super_admin | boolean If set to true, User gets Super Admin priviledges |
admin | boolean If set to true, User gets Admin priviledges |
quota | number >= 1 Deprecated |
roles | Array of strings Set of roles |
verify_auth_code | boolean If set to true, User gets email verification code |
tags | Array of strings Set of tags to be attached to User |
Responses
Request samples
- Payload
{- "user_name": "username@domain.com",
- "super_admin": true
}
Response samples
- 201
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Updates the user in user email mobile user pool
This API updates the permissions and quota of the user in user email mobile user pool.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating name of the user
user_name required | string Valid email address or valid phone number |
super_admin | boolean If set to true, User gets Super Admin priviledges |
admin | boolean If set to true, User gets Admin priviledges |
quota | number >= 1 Deprecated |
roles | Array of strings Set of roles |
verify_auth_code | boolean If set to true, User gets email verification code |
tags | Array of strings Set of tags to be attached to User |
Responses
Request samples
- Payload
{- "user_name": "user@domain.com",
- "super_admin": false
}
Response samples
- 200
- 400
- 404
- 500
{- "status": "success",
- "description": "Success description"
}
Fetches the details of a user
This API fetches all the internal users by default. If user name is provided then user_id, user_name, super_admin flag, quota, user roles, URL of profile picture and name of that user is returned.
The super_admin flag is returned only when the user is a super admin, in other cases, it will not be returned in the output.
Also the picture_url and name are not returned in the output, if it is not set by the user.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
user_name | string user_name of the user whose details are to be fetched. |
user_id | string user_id of the user whose details are to be fetched. |
start_id | string use next_id from the response as start_id to fetch the next set of records. A combination of userID and user name. |
num_records | number Default: 25 number of users to fetch |
Responses
Response samples
- 200
- 400
- 500
{- "users_list": [
- {
- "user_id": "string",
- "user_name": "string",
- "super_admin": true,
- "picture_url": "string",
- "quota": "number",
- "name": "string",
- "mfa": true,
- "phone_number": "<+Mobile Number with country code>"
}
], - "next_id": "string",
- "total": 25
}
Deletes user account
This API can be used by admin-users to delete other users account. Here are the details-
- If the 'request' query param is true, user delete request is initiated and verification code is sent to the invoking user email.
- If 'verification_code' query param is specified, user account is deleted.
- The 'super_admin' flag has higher priority over 'admin' flag.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
request | boolean Default: false if delete user request is to be initiated, value of request param should be true. |
verification_code | number Default: "<verification_code>" if delete user request is to be verified and user account is to be deleted, the verification code received by user should be entered as value of verification_code query param. |
user_name required | string user_name of the user who needs to be deleted |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Uploads node certificate's CA
This API uploads the node CA certificate
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
node_ca_certificate required | string The CA(s) of node certificates which are generated using admin CLI and node registration module |
Responses
Request samples
- Payload
{- "node_ca_certificate": "-----BEGIN CERTIFICATE-----<>-----END CERTIFICATE-----"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Get all node certificate CAs
This API gets the node CA certificates
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 500
{- "node_ca_certificate": "-----BEGIN CERTIFICATE-----<>-----END CERTIFICATE-----"
}
This API adds new webhook for specified integration.
This API adds new webhook for specified service name, endpoint and whether its enabled or not.
Service Name : Name of external service to be integrated
Endpoint Name : A Service may have more than Webhook Endpoints. Endpoint Name of Service which we are integrating to
Enabled : This flag tells whether this integration is enabled
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
request body for creating new Webhook Integration.
service_name required | string Name of external service to be integrated |
endpoint_name required | string Endpoint name of the service |
enabled required | boolean This flag tells whether this integration is enabled or not |
Responses
Request samples
- Payload
{- "service_name": "gva",
- "endpoint_name": "request_sync",
- "enabled": true
}
Response samples
- 200
- 400
- 500
{- "status": "success"
}
This API updates existing webhook configuration.
This API updates existing webhook configuration for specified integration and its endpoint.
Service Name : Name of external service to be integrated
Endpoint Name : A Service may have more than Webhook Endpoints. Endpoint Name of Service which we are integrating to
Enabled : This flag tells whether this integration is enabled
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating existing Webhook Integration configuration.
service_name required | string Name of external service to be integrated |
endpoint_name required | string Endpoint name of the service |
enabled required | boolean This flag tells whether this integration is enabled or not |
Responses
Request samples
- Payload
{- "service_name": "gva",
- "endpoint_name": "request_sync",
- "enabled": true
}
Response samples
- 200
- 400
- 500
{- "status": "success"
}
Get webhook information.
This API will get the integration information of webhook.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
service_name | string Example: service_name=mobile_push_notification, gva, alexa Name of external service |
endpoint_name | string Endpoint Name of the Service |
Responses
Response samples
- 200
- 400
- 500
{- "webhooks_endpoints": [
- {
- "service_name": "gva",
- "endpoint_name": "request_sync",
- "enabled": true
}
], - "total": 1
}
This API removes the webhooks configured for integration.
This API allows admin to remove configured webhooks for integration.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
service_name required | string Example: service_name=mobile_push_notification, gva, alexa Name of external service |
endpoint_name required | string Endpoint Name of the Service |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success"
}
Get webhook event mapping information.
This API will get the webhook integration mapping (Beta
- These APIs are in development stage and may have breaking changes)
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
webhook_name | string Webhook to be retrieved |
Responses
Response samples
- 200
- 400
- 520
{- "webhook_event_mappings": [
- {
- "webhook_name": "gva",
- "event_name": "user_node_association"
}
]
}
This API adds webhook event mapping
This API adds the webhook event mapping (Beta
- These APIs are in development stage and may have breaking changes)
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
request body for adding a webhook event mapping.
webhook_name required | string <= 1024 characters Webhook Name |
event_name required | string <= 1024 characters Event name |
Responses
Request samples
- Payload
{- "webhook_name": "gva",
- "event_name": "user_node_association"
}
Response samples
- 200
- 400
- 520
{- "status": "success",
- "description": "Success description"
}
This API removes webhook event mapping
This API removes the webhook event mapping (Beta
- These APIs are in development stage and may have breaking changes)
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
webhook_name required | string Webhook to be removed |
event_name required | string Event to be removed |
Responses
Response samples
- 200
- 400
- 520
{- "status": "success",
- "description": "Success description"
}
This API is used to get the statistical info
This API is used to get the statistical information for the various Rainmaker operational parameters like, number of registered users or number of registered nodes, etc. This information can be queried based on the parameter name and the duration.
The metrics data can be retrieved based on daily count, weekly count, monthly count or yearly count. Only one duration parameter can be specified as the query parameter.
- If none of these stats parameters or duration is specified in the request parameter, then the values for all the stats parameters with their total count is returned as the response.
- Daily Count - The start_date and end_date parameters are used to specify the date range, which is only applicable for daily_count. The difference between start and end dates can be maximum of 31 days and the end_date must be strictly greater than the start_date. The start date and end date should be specified in the YYYY-MM-DD format.
- Weekly Count - The start_month, start_year, end_month, end_year parameters are used to specify the date range for weekly_count. The weekly data can be queried for upto 3 Months
- Monthly Count - The start_month, start_year, end_month, end_year parameters are used to specify the date range for monthly_count. The monthly data can be queried for upto 12 Months
- Yearly Count - The start_year, end_year parameters are used to specify the date range for yearly_count. The yearly data can be queried for upto 5 years.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
metric_name | string Example: metric_name=num_offline_nodes,num_registered_nodes,num_registered_users There are various metrics supported. They are - |
duration | string Example: duration=daily_count This parameter is user to set the duration of the count .They can be - |
start_date | string Example: start_date=2020-04-07 This parameter is used to set the start_date, which is applicable only for daily_count. The expected Format for start_date is YYYY-MM-DD |
end_date | string Example: end_date=2020-04-07 This parameter is used to set the end_date, which is applicable only for daily_count. The expected Format for end_date is YYYY-MM-DD |
start_month | string Example: start_month=December This parameter is used to set the start_month, which is applicable only for weekly_count and monthly_count. The expected Format for start_month is month name like January. This field is case-insensitive. |
end_month | string Example: end_month=December This parameter is used to set the end_month, which is applicable only for weekly_count and monthly_count. The expected Format for end_month is month name like January. This field is case-insensitive. |
start_year | string Example: start_year=2020 This parameter is used to set the start_year, which is applicable only for weekly_count, monthly_count and yearly_count. The expected Format for start_year is YYYY |
end_year | string Example: end_year=2020 This parameter is used to set the end_year, which is applicable only for weekly_count, monthly_count and yearly_count. The expected Format for end_year is YYYY |
timezone | string Default: "UTC" Example: timezone=Asia/Calcutta This parameter is used to set the timezone(location) from where the query is made, based on IANA Tz Database name. TimeZone can also be provided like EST but location name is preferred. This field is case-insensitive. |
type | string Example: type=light This parameter is used to query for the counts of a specific node type. |
model | string Example: model=RGB_bulb This parameter is used to query for the counts of a specific node model. |
Responses
Response samples
- 200
- 400
- 404
- 500
{- "num_registered_users": {
- "total_count": 79811
}, - "num_registered_nodes": {
- "total_count": 82834
}, - "num_users_with_nodes": {
- "total_count": 83970
}, - "num_users_without_nodes": {
- "total_count": 81631
}, - "num_timed_out_node_association_reqs": {
- "total_count": 82967
}, - "num_claimed_nodes": {
- "total_count": 82560
}, - "num_online_nodes": 10,
- "num_offline_nodes": 12
}
To Initialize data for stats service
This API is used to initialize data onto the stats table.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Get the logs of failures occurred while sending emails
This API is used to fetch the details of failure occurred while sending emails to users. Mail failure logs can be fetched by reciepent email ID or Failure Type(Bounce/Complaint/Delivery).Pagination is supported with num_records and start_id query parameters. timestamp query param can be used to fetch records after that timestamp.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email_id | string Example: email_id=abc@xyz.com Email-Id of the user |
failure_type | string Enum: "Bounce" "Complaint" "Delivery" Email failure type |
timestamp | string Example: timestamp=1645623129 Epoch time from which you want to get the email failures |
start_id | string Example: start_id=abd@domain.com use next_id from the response as start_id to fetch the next set of records |
num_records | string Default: 25 Example: num_records=10 number of records to fetch |
Responses
Response samples
- 200
- 400
{- "mail_failure_records": [
- {
- "email_id": "abc@xyz.com",
- "timestamp": 1645623129,
- "failure_type": "Bounce",
- "subject": "Mail Subject",
- "reason": "Failure Reason",
- "failure_sub_type": "Failure Sub Type"
}
], - "next_id": "abd@domain.com"
}
Upgrade Rainmaker APIs
This API is used to upgrade the APIs after RainMaker is upgraded to the newer version.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Responses
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Update Terms of Use and Privacy Policy HTML Files
This API is used to update or create Terms of Use and Privacy Policy HTML files.The URLs of files are given in response.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
Either terms_of_use or privacy_policy needs to be specified
terms_of_use | string |
privacy_policy | string |
Responses
Request samples
- Payload
{- "terms_of_use": "Terms of Use file content",
- "privacy_policy": "Privacy Policy file content"
}
Response samples
- 200
- 400
- 500
{- "status": "success",
- "terms_of_use_file_url": "terms_of_use_file_url",
- "privacy_policy_file_url": "privacy_policy_file_url"
}
Get Terms of Use and Privacy Policy Files content and URL
This API is used to get content and URL of Terms of Use and Privacy Policy files.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
file | string Example: file=<file_name> File which is to be fetched in response. |
Responses
Response samples
- 200
- 400
- 500
{- "terms_of_use": {
- "content": "file_content",
- "file_url": "file_url"
}, - "privacy_policy": {
- "content": "file_content",
- "file_url": "file_url"
}
}
Delete Terms of Use and Privacy Policy Files
This API is used to delete Terms of Use and Privacy Policy files.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
file required | string Example: file=<file_name> Name of file which is to be deleted. |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Add IAM user with read permission for CloudWatch logs
This API is used to add an IAM user, with permission to read the cloudwatch logs from AWS account. The logs will be used by the IAM user for debugging purpose. API creates IAM user in AWS account and sends mail to IAM user giving login details.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
'email' is required parameter.
string |
Responses
Request samples
- Payload
{- "email": "iam user email address"
}
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Add IAM user with read permission for CloudWatch logs
This API is used to remove an IAM user, with permission to read the cloudwatch logs from AWS account.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
email required | string email address of IAM user to be deleted |
Responses
Response samples
- 200
- 400
{- "status": "success",
- "description": "Success description"
}
Change log level
This API is used to change the log level configuration of one or all lambda functions
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
function_name | string Lambda function name |
loglevel required | string Log level to be set Info, Warn, Debug or Error |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Adds a rainmaker capability
This API is used to add a capability using name and value
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/json
name required | string |
value required | string |
Responses
Request samples
- Payload
[
]
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Fetches a rainmaker capability
This API is used to get rainmaker capability using capability name
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
name | string The rainmaker capability name to be fetched |
Responses
Response samples
- 200
- 400
- 500
[
]
This API is used to get the API Statistics
This API is used to get the statistics for the RainMaker APIs called by clients like Mobile App, Dashboard, etc. Ex: /v1/user, /v1/user/nodes, etc. This information can be queried based on API Path, method and aggregation interval.
The data can be retrieved for different aggregation intervals like day, week, month or year and start_time and end_time to specify the date and time range.
- Day - Max Interval: 31 days and end_time must be strictly greater than the start_time.
- Week - Max Interval: 12 weeks.
- Month - Max Interval: 12 months
- Year - Max Interval: 3 years
How Does the API function?
- By Default with no parameters passed the API returns the API count for previous day.
- To get count for aggregation interval day, week, month, year provide repective aggregate, aggregation_interval, start_time, end_time
- Start time and end time is used to provide the timeframe for these queries.
- API path and method can be used in conjunction with group by.
- To get top 10 API's called or top 10 users calling the API for a given time duration using num_records and group_by.
- Start time and end time is used to provide the timeframe, aggregation interval is not supported for these queries.
- API path and method can be used in conjunction with group by.
- Max Interval: 31 days
Note:
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
api_path | string Example: api_path=/v1/user This parameter is used to specify the API path for which count needs to be returned. |
method | string Example: method=POST Supported methods are - |
aggregation_interval | string Default: "day" Example: aggregation_interval=day This parameter is used to specify the aggregation interval for the params. They can be - |
aggregate | string Default: "count" Example: aggregate=count Following aggregate functions are supported - Only one aggregate function can be specified at a time. |
start_time | number Example: start_time=1628557200 This parameter is used to set the start time. The expected Format for start time is epoch time in seconds. Ex: 1628557200 |
end_time | number Example: end_time=1628557200 This parameter is used to set the end time. The expected Format for end_date is epoch time in seconds. Ex: 1628557200 |
week_start | string Default: "Monday" Example: week_start=Monday This parameter is used to specify the start day of the week. This field is case insensitive. Only applicable in cases were the aggregation interval value is week. |
start_id | string This parameter is used for pagination. |
num_records | number <= 25 Default: 25 This parameter is used for pagination and to get top 10 or 20 records. |
group_by | string Example: group_by=api_path This parameter is used to set the field for which the top records are to returned. This field is case-insensitive. |
Responses
Response samples
- 200
- 400
- 500
{- "api_stats": [
- {
- "stats": [
- {
- "api_path": "/v1/user",
- "method": "POST",
- "values": [
- {
- "ts": 1625097600,
- "val": 35
}, - {
- "ts": 1625184000,
- "val": 37
}
], - "num_records": 2
}
], - "next_id": "string",
- "aggregation_interval": "day",
- "aggregate": "count"
}
]
}
This API is used to get the MQTT Statistics
This API is used to get the Statistics for the messages posted by nodes to various MQTT topics like node/+/config, node/+/params/local, etc. and node ID.This information can be queried based on aggregation interval.
The data can be retrieved for different aggregation intervals like day, week, month or year and start_time and end_time to specify the date and time range.
- Day - Max Interval: 31 days and end_time must be strictly greater than the start_time.
- Week - Max Interval: 12 weeks.
- Month - Max Interval: 12 months
- Year - Max Interval: 3 years
How Does the API function?
- By Default with no parameters passed the API returns the MQTT message count for previous day.
- To get count for aggregation interval day, week, month, year provide repective aggregate, aggregation_interval, start_time, end_time
- Start time and end time is used to provide the timeframe for these queries.
- MQTT topic and/or node ID can be used in conjunction with group by.
- To get top 10 MQTT topics called or top 10 node Ids sending the messages over MQTT topics for a given time duration using num_records and group_by.
- Start time and end time is used to provide the timeframe, aggregation interval is not supported for these queries.
- MQTT topic and/or Node ID can be used in conjunction with group by.
- Max Interval: 31 days
Note:
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
topic_name | string Example: topic_name=node/+/config This parameter is used to specify the MQTT topic name for which count needs to be returned.
|
node_id | string Example: node_id=<node_id> node IDs which are sending messages over MQTT topics |
aggregation_interval | string Default: "day" Example: aggregation_interval=day This parameter is used to specify the aggregation interval for the params. They can be - |
aggregate | string Default: "count" Example: aggregate=count Following aggregate functions are supported - Only one aggregate function can be specified at a time. |
start_time | number Example: start_time=1628557200 This parameter is used to set the start time. The expected Format for start time is epoch time in seconds. Ex: 1628557200 |
end_time | number Example: end_time=1628557200 This parameter is used to set the end time. The expected Format for end_date is epoch time in seconds. Ex: 1628557200 |
week_start | string Default: "Monday" Example: week_start=Monday This parameter is used to specify the start day of the week. This field is case insensitive. Only applicable in cases were the aggregation interval value is week. |
start_id | string This parameter is used for pagination. |
num_records | number <= 25 Default: 25 This parameter is used for pagination and to get top 10 or 20 records. |
group_by | string Example: group_by=topic_name This parameter is used to set the field for which the top records are to returned. This field is case-insensitive. |
Responses
Response samples
- 200
- 400
- 500
{- "mqtt_stats": [
- {
- "stats": [
- {
- "topic_name": "node/+/config",
- "node_id": "<node_id>",
- "values": [
- {
- "ts": 1625097600,
- "val": 35
}, - {
- "ts": 1625184000,
- "val": 37
}
], - "num_records": 2
}
], - "next_id": "string",
- "aggregation_interval": "day",
- "aggregate": "count"
}
]
}
These APIs are Deprecated. Check the APIs in the 'Admin User Management' group above.
Creates the new user
This API creates a new user. Only Email is supported as user name. Here the role is disjoint of the flags the user need to explicitly assign the required role.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for creating new user
user_name required | string Valid email address or valid phone number |
super_admin | boolean If set to true, User gets Super Admin priviledges |
admin | boolean If set to true, User gets Admin priviledges |
quota | number >= 1 Deprecated |
roles | Array of strings Set of roles |
verify_auth_code | boolean If set to true, User gets email verification code |
tags | Array of strings Set of tags to be attached to User |
Responses
Request samples
- Payload
{- "user_name": "username@domain.com",
- "super_admin": true
}
Response samples
- 201
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Updates the user
This API updates the permissions and quota of the user.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
Request Body schema: application/jsonrequired
Request body for updating name of the user
user_name required | string Valid email address or valid phone number |
super_admin | boolean If set to true, User gets Super Admin priviledges |
admin | boolean If set to true, User gets Admin priviledges |
quota | number >= 1 Deprecated |
roles | Array of strings Set of roles |
verify_auth_code | boolean If set to true, User gets email verification code |
tags | Array of strings Set of tags to be attached to User |
Responses
Request samples
- Payload
{- "user_name": "user@domain.com",
- "super_admin": false
}
Response samples
- 200
- 400
- 404
- 500
{- "status": "success",
- "description": "Success description"
}
Fetches the details of a user
This API fetches all the internal users by default. If user name is provided then user_id, user_name, super_admin flag, quota, user roles, URL of profile picture and name of that user is returned.
The super_admin flag is returned only when the user is a super admin, in other cases, it will not be returned in the output.
Also the picture_url and name are not returned in the output, if it is not set by the user.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
user_name | string user_name of the user whose details are to be fetched. |
start_id | string use next_id from the response as start_id to fetch the next set of records. A combination of userID and user name. |
num_records | string Default: 25 number of users to fetch |
Responses
Response samples
- 200
- 400
- 500
{- "users_list": [
- {
- "user_id": "string",
- "user_name": "string",
- "super_admin": true,
- "picture_url": "string",
- "quota": "number",
- "name": "string",
- "mfa": true,
- "phone_number": "<+Mobile Number with country code>"
}
], - "next_id": "string",
- "total": "number"
}
Deletes user account
This API can be used by admin-users to delete other users account. Here are the details-
- If the 'request' query param is true, user delete request is initiated and verification code is sent to the invoking user email.
- If 'verification_code' query param is specified, user account is deleted.
- The 'super_admin' flag has higher priority over 'admin' flag.
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
request | boolean Default: false if delete user request is to be initiated, value of request param should be true. |
verification_code | number Default: "<verification_code>" if delete user request is to be verified and user account is to be deleted, the verification code received by user should be entered as value of verification_code query param. |
user_name required | string user_name of the user who needs to be deleted |
Responses
Response samples
- 200
- 400
- 500
{- "status": "success",
- "description": "Success description"
}
Update the Node Parameter
This API will let admins update the state of the device
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
node_id | string node id |
Request Body schema: application/jsonrequired
Request body for updating Node Parameter
object | |
object |
Responses
Request samples
- Payload
[- {
- "node_id": "string",
- "payload": {
- "Light": {
- "brightness": 100,
- "output": true
}, - "Switch": {
- "output": true
}
}
}
]
Response samples
- 200
- 207
- 400
- 403
- 500
{- "status": "success",
- "description": "Success description"
}
Get the Node parameter
This API will Get the state of the device
Authorizations:
path Parameters
version required | string Default: "v1" API Version (Current supported API Version is 'v1') |
query Parameters
node_id required | string node id |
Responses
Response samples
- 200
- 400
- 403
- 500
{- "Light": {
- "brightness": 100,
- "output": true
}, - "Switch": {
- "output": true
}
}