Quick jump to call

This will open the pages in a new tab.

GET / Info
GET / History events
GET / Process status
GET / History logins
POST / Email create
POST / Notification create


GET - Info
This will fetch the account information for the user accessing the API like username, first and last name, email, account credit, and location information.

Request URL
https://api.nodehost.cloud/get_account_info

Parameters
None

More info
None

Response
{
"data": {
"id": "1232",
"username": "apiuser",
"first_name": "API",
"last_name": "User",
"email": "support@nodehost.ca",
"email_alerts": "0",
"email_recepts": "false",
"email_updates": "0",
"register_date": "1538862744",
"type": "normal",
"verified": "false",
"referral": "0",
"parent": "0",
"credit": "56",
"credit_referral": "0",
"country": "Canada",
"state": "British Columbia"
},
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}



GET - History events
Will return a list of history events for the account for creation and destroy of resources in containers, storage and other areas.

Request URL
https://api.nodehost.cloud/get_account_history_events

Parameters
None

More info
None

Response
{
"data": [
{
"id": "864",
"user": "1232",
"time_added": "20181006191945",
"event": "Created a new worker with the name Test worker, time to learn some SimpleScript",
"tag": "worker_create"
},
{
"id": "863",
"user": "1232",
"time_added": "20181006191908",
"event": "Created a new storage folder with the name Photos",
"tag": "storage_folder_create"
},
{
"id": "862",
"user": "1232",
"time_added": "20181006191854",
"event": "Just changed the Important speed containers name to My first container",
"tag": "container_update_info_nickname"
}
],
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}



GET - Process status
This will fetch a process based on its ID and return the results.

Request URL
https://api.nodehost.cloud/get_account_history_events

Parameters
id - The ID of the process

More info
The value status_ran if true means the process is finished and the response is saved. You can also see the time it was added status_time_added and the status_time_run that tells you when the system was set to run the process. Note: we do run processes spawned by processes, and this will not show the status of the secondary processes.

When you run a API call that runs a task it will have a value at the bottom of the response called system_process_id. This gives you the ID you can check in this list to see the status of the job. The value of system_process_id will be false if no process was started with the API call.

Process system appends to the start of all responses a tag like error: for automated matching. The response starts you might get are listed below. An for example here is a response you might get completed: Container usage info updated.

Response
{
"data": {
"status_id": 1103113,
"status_ran": "true",
"status_running": "true",
"status_function": "services_container_create_database",
"status_response": "completed: The database structure has been created",
"status_user_visible": "true",
"status_time_added": 20181224014459,
"status_time_run": 20181224014504
},
"system_connection": "true",
"system_version": "v_79_d65cb6f",
"system_user_id": 1232,
"system_user_username": "apiuser",
"system_process_id": "false",
"system_process_command": "false"
}



GET - History logins
Will return a list of login events, this includes failed login attempts.

Request URL
https://api.nodehost.cloud/get_account_history_logins

Parameters
None

More info
The status codes you can see for the login events are normal, 2fa_stoped, 2fa_failed, failed. When a user is taken to a 2FA page and is unable to login and closes the page you get a 2fa_stoped status code, and if they attempted to login using a 2FA code you will see 2fa_failed.

Response
{
"data": [
{
"status": "failed",
"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15",
"date": "20181008020424",
"ip": "104.204.159.101"
},
{
"status": "normal",
"useragent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15",
"date": "20181006175225",
"ip": "184.68.59.42"
}
],
"system_connection": "true",
"system_version": "v_56_330930f",
"system_user_id": "1232",
"system_user_username": "apiuser"
}



POST - Email create
Sends a email with a given subject, message, and type tag to the user.

Request URL
https://api.nodehost.cloud/post_account_email_create

Parameters
subject - Subject for the message
message - The message content
type - The type, you can use alert, receipts, or update

More info
The types you can use are alert, receipts, and update. The system checks before sending if the user has that type turned on, if they dont the email wont be sent.

Response
{
"data": "Email Sent",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}



POST - Notification create
Sends a notification with a given label, and a optional link to a resource to the user.

Request URL
https://api.nodehost.cloud/post_account_notification_create

Parameters
label - A lable for the notification sender
notification - The content for the notification

More info
You can set the optional Link in the parameter link.

Response
{
"data": "Notification sent",
"system_connection": "true",
"system_version": "v_55_65418c9",
"system_user_id": "1232",
"system_user_username": "apiuser"
}
Was this article helpful?
Cancel
Thank you!