AYON REST API
What is a REST API?
REST is a short name for RESTful
which is a programming interface that allows you to communicate with web servers via HTTP
requests to access and use data.
HTTP requests include POST
(create), GET (read), PUT
(update) and DELETE data.
These 4 types of requests form the famous terminology CRUD
: Create, Read, Update and Delete.
AYON REST API
You can use AYON REST API
to manipulate AYON Resources.
e.g. you can use it to get a list of projects or create new projects, get a list of current users or add users and manage resources e.g. download or upload AYON Launcher, addons and dependency packages.
Each AYON server generates docs for its REST API as they can be extended via Addons Devolvement
You access the REST API Docs via <your-ayon-server-url>/api
or via help icon.
For instance, you can check the REST API Docs for our Public AYON Server here at AYON REST API Docs
Your First AYON API Calls
Examples in this section were brought from the following Community guide. Feel free to check it and delve into discussions.
Let's do our first api calls where we will login into AYON and get a list available projects. For this purpose consider using a REST client such as postman or VsCode Thunder Client.
For the following example, I'll stick to VsCode Thunder Client
.
Login into AYON
- Write a login request:
<your-ayon-server-url>/api/auth/login
- Add name and password
- Send
- Find the token.
Get list of projects
You'll need the token from the last call.
- write a login request:
<your-ayon-server-url>/api/projects
- Add your token
- Send
- Find the available projects.
Conclusion
As you may have noticed, using the API, sending and processing the data is not meant to be read and processed by Humans.
we should do that with the aid of scripts where we can deal with them from a higher perspective where we can use a command like get_projects_names
and it should use the proper API call and process the output for us.
and, that's why REST API is called a programming interface.
While AYON REST API solely doesn't process the data for us. You would need to write the essential code to make the API call and then process the data before displaying it for you. For example check AYON REST API Guide to explore different ways to make REST API calls.