Getting Started Edit
Welcome to the API documentation for Axelib version 0.1
Here will be explained differents ways to benefits from the power of this BaaS.
In addition to the JS library, the PHP class available here.
The baseUrl is : «https://api.axelib.io» always followed by the version number
This API is still under development and will evolve.
var ax = new Axelib({
code: "XabC70",
version: 0.1
})
ax.ServerCall({
method: METHOD_NAME, // Axelib Method
entity: ENTITY, // Your entity name
data: PAYLOAD, // Request Payload (if needed)
id: ID, // ID of the record
success: function() {}, // Success calback method
error: function() {}, // Error calback method
timeout: 10 // Timeout of your REST API call
})
Authentication Edit
You need to be specify your project for all API requests, and sometimes be authenticated. You can generate an API key in your developer platform, by creating a new project.
Add the API key to all requests as a HEADER parameter.
Nothing will work unless you include this API key (Project ID)
To obtain a valide token, you need to login to the application.
The token should also passed as a HEADER parameter.
{
"projectID": "XabC70",
"token": "Bearer eyBP..."
}
Errors Edit
Code | Name | Description |
---|---|---|
200 | OK | Success |
201 | Created | Creation Successful |
400 | Bad Request | We could not process that action |
403 | Forbidden | We couldn’t authenticate you |
All errors will return JSON in the following format :
{
"error": true,
"message": "error message here"
}
You can find a complete list of all exceptions and errors here
/books Edit (example)
The Post methods creates a new record into the targeted entity.
Fields and values must be sent over the http POST.
Parameters
- title
- The title for the book
- year
- The release year of the book
The book will automatically be created into our entity
Adds a book to your entity and returns the record ID.
// The variable data represents your payload
ax.ServerCall("post", "book", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/post/book
or
https://api.axelib.io/0.1/book
{
"title": "I got a feeling",
"year": "2007"
}
{
"success": true,
"message": "Record successfully created",
"entity": "book",
"id": 1
}
{
"error": true,
"message": "Invalid score"
}
/books Edit (example)
Return records from the requested entity.
In this example, the result will be a list of books.
Or, legacy method "list"
baseUrl/list/:entityParameters
- filter
- The filter you want to apply, URL encoded
By default, only 10 records are returned
It is possible to filter the results using the filter param, or sending them by post method using the legacy List method. Please find below a list of filters you can apply.
Parameters
- orderBy
- To order the list returned (ex: "orderBy": "year:desc")
- fields
- To specify the fields you would like to see in the result
You can also make the following comparisons between fields and values:
- "title" : "like:sun" to return all books with title that contains "sun"
- "year" : ">=:2017" for all books released after the year 2017
To create a pagination of results, just send the page number and number of results by page
baseUrl/:entity/:page/:nbresultOr, legacy method "list"
baseUrl/list/:entity/:page/:nbresult
You can also create associations an return the results of your combinasons :
- "join:author": "author.id=book.id_author"
- "count:book": "book.id_author=7"
- "exist:author": "author.id=book.id_author"
- "prop:author": "author.id=book.id_author"
- "plus:author": "author.id=book.id_author"
- "linkedto:author": "author.id=book.id_author"
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// The variable data represents your filter payload (if needed)
ax.ServerCall("list", "book", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/book
https://api.axelib.io/0.1/list/book
https://api.axelib.io/0.1/list/book/1/20
{
"success":true,
"entity": "book",
"data": [
{
"id": 1,
"title": "The Hunger12 Games",
"score": 4.5,
"dateAdded": "12/12/2013"
}, {
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
}
],
"count": 89
}
{
"error": true,
"message": "Invalid offset"
}
/books/:id Edit (example)
Get Book
This method returns the record wich ID is given in query param
baseUrl/:entity/:idOr, legacy method "get"
baseUrl/get/:entity/:id// The variable ID being your record ID
ax.ServerCall("get", "book", null, ID, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/book/1
https://api.axelib.io/0.1/get/book/1
{
"id": 3,
"title": "The Book Thief",
"year": 2008
}
{
"error": true,
"message": "Book doesn't exist"
}
/books/:id Edit (example)
The PATCH method updates an existing record into the remote database.
ID must be given as query param.
Or, legacy method "update"
baseUrl/update/:entity/:idParameters
- year
- The book's year
Update an existing book in your collection.
// Variable data represents your change payload
ax.ServerCall("update", "book", data, ID, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/book/1
https://api.axelib.io/0.1/update/book/1
{
"year": "2007"
}
{
"success": true,
"message": "Record updated"
}
{
"error": true,
"message": "Book doesn't exist"
}
/books/:id Edit (example)
Deletes a book
This methods delete a record into an entity, knowing its ID.
The record ID must be given or query will fail.
// Record ID must be given
ax.ServerCall("delete", "book", null, ID, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/delete/book/1
{
"id": 3,
"status": "deleted"
}
{
"error": true,
"message": "Book doesn't exist"
}
/file/upload Edit
Upload file
This method uploads files into the Cloud throught the API. It is possible to link an uploaded file to a record having a field of type file
Parameters
- file
- File Object data URL
- target_table
- Name of the table to save file
- target_field
- Name of the field in which file will be saved
- target_id
- ID of the record that will receive the file
Once file is uploaded, the file path is returned
//Variable data being your payload
ax.ServerCall("file", "upload", data, null, SuccessCallback, ErrorCallback);
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/file/upload
{
"file": "FILE",
"target_table": "TARGET_ENTITY",
"target_field": "TARGET_FIELD",
"target_id": "TARGET_ID"
}
{
"success": true,
"message": "File uploaded ! Created new record, ID : 56",
"file": "https://files.axelib.io/apps/Y8hSCWA/0_1579452772.txt",
"id": 56
}
{
"error": true,
"message": "Invalid offset"
}
/register/user Edit
Register
This method allow the user to register into the application with his email and password given as POST parameters.
Parameters
- The user email
- password
- The user password
(must fit the rules defined in platform)
The book will automatically be added to your reading list
Adds a book to your collection.
// Variable data is your registration payload
ax.ServerCall("register", "auth", data, null, SuccessCallback, ErrorCallback);
//Or
ax.register(data.email, data.password, SuccessCallback, ErrorCallback);
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/register/user
{
"email": "your_email",
"password": "your password"
}
{
"success": true,
"message": "Successfully subscribed"
}
{
"error": true,
"message": "Invalid score"
}
/login/user Edit
Login
This method connects the user to the application through his email and password given as POST parameters.
If login is successful, a token will be return. This token must be sent as described above into the header of each query to identify the user.
Parameters
- The user email
- password
- The user password
(must fit the rules defined in platform)
The default token lifetime is 6 hours
Adds a book to your collection.
// bla
ax.ServerCall("login", "auth", data, null, SuccessCallback, ErrorCallback);
//Or
ax.login(data.email, data.password, SuccessCallback, ErrorCallback);
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/login/user
{
"email": "your_email",
"password": "your password"
}
{
"success": true,
"token": "ey...",
"exp": "2031-02-04T09:28:11Z",
"user": {
"id": 2,
"admin": 0,
"date_create": "2019-08-26 01:39:36",
"date_update": "2019-09-08 15:22:12",
"nickname": "bandzagilles",
"email": "bandzagilles@yahoo.fr"
...
}
}
{
"error": true,
"message": "Invalid score"
}
/logout/user Edit
Log out
Logs the user out of the application.
The session will be closed and token invalidated
// hello
ax.ServerCall("logout", "user", null, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/logout/user
{
"success": true,
"message": "You've been logged out. Your session is closed"
}
{
"error": true,
"message": "Invalid score"
}
/alive/user Edit
Alive
This method checks the current status of the user's session.
The book will automatically be added to your reading list
Adds a book to your collection.
// hello
ax.ServerCall("alive", "user", null, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
https://api.axelib.io/0.1/alive/user
https://api.axelib.io/0.1/alive/user
{
"success": true,
"alive": true,
"message": "You are logged in !"
}
{
"error": true,
"message": "Invalid score"
}
/forgotpwd/user Edit
Forgot / Reset password
Parameters
- The email of the user
The book will automatically be added to your reading list
Adds a book to your collection.
// data is the payload with email
ax.ServerCall("forgotpwd", "auth", data, null, SuccessCallback, ErrorCallback);
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/forgotpwd/user
{
"email": "email@domain.you"
}
{
"id": 3,
"title": "The Book Thief",
"score": 4.3,
"dateAdded": "5/1/2015"
}
{
"error": true,
"message": "Invalid score"
}
/changepwd/user Edit
Change password
This methods updates the user's password. His session is not disconnected.
Parameters
- password
- User's current password
- new_password
- User's new password
You must be connected to run this API
Adds a book to your collection.
// Variable data represents your payload
ax.ServerCall("changepwd", "user", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/changepwd/user
{
"password": "*******",
"new_password": "*********"
}
{
"success": true,
"message": "Password was updated !"
}
{
"error": true,
"message": "Invalid score"
}
/changemail Edit
Change E-mail
Changes the email of the connected user
Parameters
- Current user's email
- new_email
- New user's email
- password
- User's password
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// Variable data represents your payload
ax.ServerCall("changemail", "user", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/changemail/user
{
"email": "a@b.com",
"new_email": "a@b.com",
"password": "*****"
}
{
"success": true,
"message": "Your email has been updated !2 : helloworld1@yahoo.com"
}
{
"error": true,
"message": "Invalid offset"
}
/optin/:resource Edit
Opt-In
This method Opts In the concerned resource. The resource can be :
- a User
- a Device
When the resource is a device, you must specify the token (device registration token) to identify the device
Parameters
- token
- Device registration token
The subscription can be made for a channel (distribution list) push os email
// GLobal optin
ax.ServerCall("optin", "user", null, null, SuccessCallback, ErrorCallback)
ax.ServerCall("optin", "device", data, null, SuccessCallback, ErrorCallback)
// Optin for channel
ax.ServerCall("optin", "user", null, "channel", SuccessCallback, ErrorCallback)
ax.ServerCall("optin", "device", data, "channel", SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/optin/user
https://api.axelib.io/0.1/optin/device
https://api.axelib.io/0.1/optin/user/:channel
https://api.axelib.io/0.1/optin/device/:channel
{
"token": registrationId
}
{
"error": true,
"message": "Invalid offset"
}
/optout/:resource Edit
Opt-Out
This method Opts Out the concerned resource. The resource can be :
- a User
- a Device
When the resource is a device, you must specify the token (device registration token) to identify the device
Parameters
- token
- Device registration token
The subscription can be made for a channel (distribution list) push os email
This call will return a maximum of 100 books
// GLobal optout
ax.ServerCall("optout", "user", null, null, SuccessCallback, ErrorCallback)
ax.ServerCall("optout", "device", data, null, SuccessCallback, ErrorCallback)
// optout for channel
ax.ServerCall("optout", "user", null, "channel", SuccessCallback, ErrorCallback)
ax.ServerCall("optout", "device", data, "channel", SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/optout/user
https://api.axelib.io/0.1/optout/device
https://api.axelib.io/0.1/optout/user/:channel
https://api.axelib.io/0.1/optout/device/:channel
{
"token": registrationId
}
{
"error": true,
"message": "Invalid offset"
}
/mail Edit
This function sends email, using the ID of the user. If ID is not known, send the email in the query
To make sure you respect the RGPD implentation, please use IDs
Parameters
- title
- Email title
- body
- THe body of the email (supports HTML)
- Email of the person if ID not given
- template
- Name of the email template
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// hello
ax.ServerCall("mail", "user", data, ID, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/mail/user/1
https://api.axelib.io/0.1/mail/channel/:ChannelName
https://api.axelib.io/0.1/mail/user/broadcast
{
"title": "Hello world",
"body": "This is a great day !",
"email": "email@domain.you" //If ID is not given
}
[
{
"id": 1,
"title": "The Hunger1 Games",
"score": 4.5,
"dateAdded": "12/12/2013"
},
{
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
},
]
{
"error": true,
"message": "Invalid offset"
}
/push Edit
Push
This methods send push notifications to users using your application.
Firebase and APNS must be set on the back into the platform
Parameters
- title
- Title of the push notification
- body
- Body of the push notification
- additional_info
- Any other information you need to pass
This call will return a maximum of 100 books
// hello
ax.ServerCall("push", "user", data, 1, SuccessCallback, ErrorCallback)
ax.ServerCall("push", "channel", data, "channelName", SuccessCallback, ErrorCallback)
ax.ServerCall("push", "instance", data, "broadcast", SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/push/user/1
https://api.axelib.io/0.1/push/channel/{ChannelName}
https://api.axelib.io/0.1/push/instance/broadcast
{
"title": "Title",
"message": "Body…",
"additional_info": "value"
}
[
{
"id": 1,
"title": "The Hunger1 Games",
"score": 4.5,
"dateAdded": "12/12/2013"
},
{
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
},
]
{
"error": true,
"message": "Invalid offset"
}
/sms Edit
SMS
This methods helps send SMS. You need to setup LWS in the platform.
Parameters
- number
- Phone number of the person that will receive the SMS
- message
- Message to be sent by SMS
This call will return a maximum of 100 books
// Variable data represents your payload
ax.ServerCall("sms", "user", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
https://api.axelib.io/0.1/sms/user
https://api.axelib.io/0.1/sms/user/{ID}
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/sms/user
https://api.axelib.io/0.1/sms/user/{ID}
{
"number": "+336 88 88 88 88",
"message": "Hello world, how are you ?"
}
{
"success": true,
"message": "SUCCESS\nEnvoi du sms en cours."
}
{
"error": true,
"message": "Invalid offset"
}
/built-in-message Edit
List all books
This method returns all messages in a conversation between two uwers while using built-in-message.
Parameters
- 1
- ID of the first user
- 2
- ID of the second user
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// hello
ax.ServerCall("list", "built-in-message", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/list/built-in-message
{
"1": 1,
"2": 2
}
{
"success": true,
"data": [
{
"id": 10,
"beta": 0,
"date_create": "2020-01-10 17:45:26",
"user_create": 5,
"user_update": -1,
"date_update": "2020-01-10 17:45:26",
"id_user": 6,
"message": "how are you ?",
"read": 0
},
...
],
"count": 2
}
{
"error": true,
"message": "Invalid offset"
}
/pusher Edit
Pusher
Pusher
Parameters
- offset
- Offset the results by this amount
- limit
- Limit the number of books returned
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// hello
ax.ServerCall("pusher", "instance", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/pusher/instance
{
"error": true,
"message": "Invalid offset"
}
[
{
"id": 1,
"title": "The Hunger1 Games",
"score": 4.5,
"dateAdded": "12/12/2013"
},
{
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
},
]
{
"error": true,
"message": "Invalid offset"
}
/query Edit
Query
This method runs a stored query
Parameters
- offset
- Offset the results by this amount
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// hello
ax.ServerCall("query", "queryName", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/query/:queryName
{
"error": true,
"message": "Invalid offset"
}
[
{
"id": 1,
"title": "The Hunger1 Games",
"score": 4.5,
"dateAdded": "12/12/2013"
},
{
"id": 1,
"title": "The Hunger Games",
"score": 4.7,
"dateAdded": "15/12/2013"
},
]
{
"error": true,
"message": "Invalid offset"
}
/logic Edit
Run logic
This method will execute complexe queries with rules.
Parameters
- offset
- Offset the results by this amount
This call will return a maximum of 100 books
Lists all the photos you have access to. You can paginate by using the parameters listed above.
// hello
ax.ServerCall("logic", "logicName", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/logic/logicName
{
"param1": "value1"
}
{
"success": true,
"logic": "logicName",
"data": "30"
}
{
"error": true,
"message": "Invalid offset"
}
/kpi Edit
KPIs
This function returns the KPIs of the application. These KPIs are defined in the platform and are metrics about the data of your applications.
This call will return a maximum of 100 books
// hello
ax.ServerCall("kpi", "instance", null, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/kpi/instance
{
"success": true,
"instance": {
"simple": [
{
"name": "kpi1",
"type": "number",
"description": "kpi1",
"value": {
"cat": 40,
"success": true
}
}
],
"complex": []
}
}
{
"error": true,
"message": "Invalid offset"
}
/sql Edit
SQL query
This method runs a SQL query on your model
Parameters
- sql
- Any SQL query
This method is not enabled by default, to protect your projects
We recommand the usage of query method, since the code is protected and stored on the server
// hello
ax.ServerCall("sql", "query", data, null, SuccessCallback, ErrorCallback)
var w = "ok";
$.get("http://api.myapp.com/books/", { "token": "YOUR_APP_KEY"}, function(data) {
alert(data);
});
var request = require("request");
request("http://api.myapp.com/books?token=YOUR_APP_KEY", function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
https://api.axelib.io/0.1/sql/query
{
"sql": "SELECT * FROM $.book"
}
{
"success": true,
"sql": "query",
"data": [
{
"id": "1",
"beta": "0",
"date_create": "2019-08-21 22:36:59",
"user_create": "-1",
"user_update": "-1",
"date_update": "2019-09-08 16:23:50",
"name": "Camael",
"image": "",
"age": "0"
},
...
]
}
{
"error": true,
"message": "Invalid offset"
}