- 08 Mar 2023
- 1 Minute to read
- Contributors
- Print
- DarkLight
About Document360 API
- Updated on 08 Mar 2023
- 1 Minute to read
- Contributors
- Print
- DarkLight
Document360 RESTful APIs will allow you to integrate your documentation with your software, allowing you to easily onboard new users, manage your articles and more.
In the documentation, you will find a list of all publicly exposed endpoints and descriptions on how to use them. In the core concepts, you can learn more about the general functionality of the APIs, as well as any restrictions.
Every call is validated against your own personal token. Follow the instructions below to see how to obtain the token and make your first Document360 API call.
Hello, World!
This example will showcase the basic use of Document360 RESTful APIs. To demonstrate we have prepared a simple PowerShell application, which makes a request to projects endpoint to retrieve all of your projects' versions
Step 1
First, you need to generate a new token, you can do so by going to Project > Settings > API Token
You can find detailed steps here API Token Management
Step 2
Create new file hello_worl.ps1 somewhere on your machine and paste the following code. Remember to populate $apiToken variable with your projects' token
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$apiToken = "Your API token goes here";
$baseUrl = "https://apihub.document360.io/v1/"
$path = "ProjectVersions";
$headers = @{
'Content-Type' = 'application/json';
'api_token' = $apiToken;
}
$uri = "$baseUrl$path";
Write-Host "Sending request"
$response = Invoke-RestMethod -Uri $uri -Method Get -Headers $headers
if($response.success -eq $true)
{
Write-Host "Request was successfull" -f green;
Write-Host "Found" $response.data.Count "project version(s)";
Write-Host "Response data:"
$response.data;
}
else
{
Write-Host "Request failed" -f red;
Write-Host "Response data:"
$response;
}
Step 3
Open the file in PowerShell command line or PowerShell ISE and execute it.
If everything was successful you should see a similar output to the one below:
Sending request
Request was successfull
Found 1 project version(s)
Response data:
id : 7ba483c0-0929-4bb6-aa43-04a2f4bb8893
version_number : 1.0
base_version_number : 0.0
version_code_name : v1
is_main_version : True
is_beta : False
is_public : True
is_deprecated : False
created_at : 2018-10-19T09:39:14.617Z
modified_at : 2018-10-19T09:39:14.617Z