API
Last updated
Was this helpful?
Last updated
Was this helpful?
The API reference documentation provides detailed information for each of the methods and endpoints of the platform.
The information can be used for reporting, reading collections, and accessing routes on the platform.
We have language bindings in NodeJs, C#, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
For application development please refer .
This code is used to print logs.
This code is used to prepare requests to external API/Endpoints
This code is used to get all domains on the instance
This code is used to check the .
This code is used to encrypt text.
This code is used to decrypt text.
This code is used publish message to a topic.
This code is used to log text.
This code is used to get property.
This code is used to fetch all global properties.
This code is used to send email.
This code is used to send SMS.
This code is used to run DB Aggregation.
This code is used to run user script.
This code is used to check if the collection belong to EDU domain.
This code is used to sign and return user token.
Database API is accessible via the global "ob" object as "ob.db".
Querying DB via HTTP Endpoints is really easy and follows a simple key value pair standard.
Example:
Consider a collection name TASK
It has following fields :
Fields
Type
Description
name
text
amount
number
created_on
datetime
manager
reference
oquery=name=Dave Smith
oquery=name=Dave Smith,amount=0
oquery=name==Dave Smith
oquery=name=!=Dave
oquery=name=*Dave
oquery=name=!*Dave
oquery=amount===0
oquery=amount=>0
oquery=amount=<0
oquery=created_on=today
oquery=created_on=yesterday
oquery=created_on=daybeforeyesterday
oquery=created_on=#in2018-07
oquery=created_on=on2018-07-15
To obtain an access token, use this code:
Make sure to replace
Username & Password
with your login credentials.
SOFOS expects a security tokem to be included in all API requests to the server in a header that looks like the following:
Authorization: Bearer
This endpoint retrieves all kittens.
POST http://*.obto.co/auth
Parameter
Default
Description
user_name
NA
Your user name which is used to login
password
NA
Your password which is used to login
Every collection in SOFOS is accessible via a HTTP API.
Example :
https://*.obto.co/o/recs/?stream=true&project=&oquery=
This endpoint retrieves a data from a specified collection.
GET https://*.obto.co/o/recs/?stream=true&project=&oquery=
Parameter
Value
Description
stream
true
The ID of the kitten to retrieve
projection
comma seperate list of fields to show
oquery
See API Query Builder
This endpoint will create a new record in the collection specified
POST https://*.obto.co/o/
Body
Description
Json Data
Data to be posted
The SOFOS API uses the following error codes:
Error Code
Meaning
400
Bad Request -- Your request is invalid.
401
Unauthorized -- Your API key is wrong.
403
Forbidden -- The kitten requested is hidden for administrators only.
404
Not Found -- The specified kitten could not be found.
405
Method Not Allowed -- You tried to access a kitten with an invalid method.
406
Not Acceptable -- You requested a format that isn't json.
410
Gone -- The kitten requested has been removed from our servers.
418
I'm a teapot.
429
Too Many Requests -- You're requesting too many kittens! Slow down!
500
Internal Server Error -- We had a problem with our server. Try again later.
503
Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
SOFOS uses API keys to allow access to the API. You can register a new SOFOS API key at our .