Accessing and running app services
After deploying your application to an environment, you can access and run your app services by calling the exposed RESTful API endpoints.
To call your endpoints, you basically need three things;
1- The endpoint URL and method. The URL of your endpoint is the concatenation of the root endpoint and its path. You can get the root endpoint information from the environment details view. The API Base URL is the root endpoint of your endpoint. You can get the method and path information of the endpoint from the endpoints view. For example, if you have a root endpoint https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0 and a POST endpoint with the path /suppliers to create a new supplier in the database, then your endpoint URL becomes https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers. If you send a POST request with the right credentials and input parameters, Algotic executes your endpoint service and creates a supplier object in the database.
Environment details view - API Base URL (root endpoint)
Endpoints view - Endpoint methods and paths
You can also get all the required information (URL, path parameters, query string parameters, required headers, authentication requirements and request body structure etc.) about how to call your endpoints from the API documentation. To access the API documentation of your endpoints, navigate to the environments view, select the environment you would like to view, and from the environment view, select the "Endpoints" tab.
Endpoint documentation
You cal also access your endpoint URLs and required input parameters structure through the Test Panel.
2- A valid API key of the environment and a session token, if required
3- Input parameters of your endpoint service (e.g., request body, headers, query parameters)
Building on the example of creating a new supplier in the database, you can call your "Add New Supplier" endpoint as follows:
cURL
JavaScript - XHR
Javascript - Fetch
Nodejs
Python
Ruby
PHP
C#
1
curl --location --request POST 'https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers' \
2
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE' \
3
--header 'Session: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc' \
4
--header 'Content-Type: application/json' \
5
--data-raw '{
6
"name": "Precision Metal Works Inc.",
7
"address": {
8
"street": "123 Clark St.",
9
"state": "IL",
10
"zipcode": 90910
11
}
12
}'
Copied!
1
var data = {
2
name: 'Precision Metal Works Inc.',
3
address: {
4
street: '123 Clark St.',
5
state: 'IL',
6
zipcode: 90910,
7
},
8
};
9
10
var xhr = new XMLHttpRequest();
11
xhr.withCredentials = true;
12
13
xhr.addEventListener("readystatechange", function() {
14
if(this.readyState === 4) {
15
console.log(this.responseText);
16
}
17
});
18
19
xhr.open("POST", "https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers");
20
xhr.setRequestHeader("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE");
21
xhr.setRequestHeader("Session", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc");
22
xhr.setRequestHeader("Content-Type", "application/json");
23
24
xhr.send(data);
Copied!
1
var myHeaders = new Headers();
2
myHeaders.append("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE");
3
myHeaders.append("Session", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc");
4
myHeaders.append("Content-Type", "application/json");
5
6
var raw = {
7
name: 'Precision Metal Works Inc.',
8
address: {
9
street: '123 Clark St.',
10
state: 'IL',
11
zipcode: 90910,
12
},
13
};
14
15
var requestOptions = {
16
method: 'POST',
17
headers: myHeaders,
18
body: raw,
19
redirect: 'follow'
20
};
21
22
fetch("https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers", requestOptions)
23
.then(response => response.text())
24
.then(result => console.log(result))
25
.catch(error => console.log('error', error));
Copied!
1
var axios = require('axios');
2
var data = {
3
name: 'Precision Metal Works Inc.',
4
address: {
5
street: '123 Clark St.',
6
state: 'IL',
7
zipcode: 90910,
8
},
9
};
10
11
var config = {
12
method: 'post',
13
url: 'https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers',
14
headers: {
15
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE',
16
'Session': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc',
17
'Content-Type': 'application/json'
18
},
19
data : data
20
};
21
22
axios(config)
23
.then(function (response) {
24
console.log(JSON.stringify(response.data));
25
})
26
.catch(function (error) {
27
console.log(error);
28
});
29
Copied!
1
import requests
2
3
url = "https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers"
4
5
payload="{\n \"name\": \"Precision Metal Works Inc.\",\n \"address\": {\n \"street\": \"123 Clark St.\",\n \"state\": \"IL\",\n \"zipcode\": 90910\n }\n}"
6
headers = {
7
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE',
8
'Session': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc',
9
'Content-Type': 'application/json'
10
}
11
12
response = requests.request("POST", url, headers=headers, data=payload)
13
14
print(response.text)
Copied!
1
require "uri"
2
require "net/http"
3
4
url = URI("https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers")
5
6
https = Net::HTTP.new(url.host, url.port)
7
https.use_ssl = true
8
9
request = Net::HTTP::Post.new(url)
10
request["Authorization"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE"
11
request["Session"] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc"
12
request["Content-Type"] = "application/json"
13
request.body = "{\n \"name\": \"Precision Metal Works Inc.\",\n \"address\": {\n \"street\": \"123 Clark St.\",\n \"state\": \"IL\",\n \"zipcode\": 90910\n }\n}"
14
15
response = https.request(request)
16
puts response.read_body
17
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'POST',
14
CURLOPT_POSTFIELDS =>'{
15
"name": "Precision Metal Works Inc.",
16
"address": {
17
"street": "123 Clark St.",
18
"state": "IL",
19
"zipcode": 90910
20
}
21
}',
22
CURLOPT_HTTPHEADER => array(
23
'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE',
24
'Session: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc',
25
'Content-Type: application/json'
26
),
27
));
28
29
$response = curl_exec($curl);
30
31
curl_close($curl);
32
echo $response;
Copied!
1
var client = new RestClient("https://dev001.na-dev-engine.altogic.com/e:611e80ad3e5034001b6603b0/suppliers");
2
client.Timeout = -1;
3
var request = new RestRequest(Method.POST);
4
request.AddHeader("Authorization", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBhNjNhMmM0ODNkMzQwMDUyNGRlNDdkIiwiaWF0IjoxNjIxNTA2NjA0LCJleHAiOjI0ODU1MDY2MDR9.-w9jGyEkdLsdCO8MDm7EZv9r8uLs71FUUeDnb5t08OE");
5
request.AddHeader("Session", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbnZJZCI6IjYwYTYzOWQ4NDgzZDM0MDA1MjRkZTQ3YSIsImtleUlkIjoiNjBiYjIwOTM4Yzc2ODkwMDk1NjUzZjQzIiwiaWF0IjoxNjIyODc2MzA3LCJleHAiOjI0ODY4NzYzMDd9.Y-Q5swY7_nS1DaV_m-OyWUhfADZpYPwoHSUfF1fLcXc");
6
request.AddHeader("Content-Type", "application/json");
7
request.AddParameter("application/json", "{\n \"name\": \"Precision Metal Works Inc.\",\n \"address\": {\n \"street\": \"123 Clark St.\",\n \"state\": \"IL\",\n \"zipcode\": 90910\n }\n}", ParameterType.RequestBody);
8
IRestResponse response = client.Execute(request);
9
Console.WriteLine(response.Content);
Copied!
Copy link