Documents
Get Upload Url
POST
/
api
/
v1
/
documents
/
upload-url
Get Upload Url
curl --request POST \
--url https://api.diginacape.co.ke/documents/api/v1/documents/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"content_type": "<string>",
"document_category": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"description": "<string>",
"tags": "<string>",
"is_public": false,
"allowed_departments": "<string>",
"allowed_users": "<string>",
"allowed_roles": "<string>",
"expires_minutes": 15
}
'import requests
url = "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url"
payload = {
"filename": "<string>",
"content_type": "<string>",
"document_category": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"description": "<string>",
"tags": "<string>",
"is_public": False,
"allowed_departments": "<string>",
"allowed_users": "<string>",
"allowed_roles": "<string>",
"expires_minutes": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
content_type: '<string>',
document_category: '<string>',
resource_type: '<string>',
resource_id: '<string>',
description: '<string>',
tags: '<string>',
is_public: false,
allowed_departments: '<string>',
allowed_users: '<string>',
allowed_roles: '<string>',
expires_minutes: 15
})
};
fetch('https://api.diginacape.co.ke/documents/api/v1/documents/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>',
'content_type' => '<string>',
'document_category' => '<string>',
'resource_type' => '<string>',
'resource_id' => '<string>',
'description' => '<string>',
'tags' => '<string>',
'is_public' => false,
'allowed_departments' => '<string>',
'allowed_users' => '<string>',
'allowed_roles' => '<string>',
'expires_minutes' => 15
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.diginacape.co.ke/documents/api/v1/documents/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diginacape.co.ke/documents/api/v1/documents/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required string length:
1 - 255Maximum string length:
50Maximum string length:
50Maximum string length:
255Maximum string length:
1000Required range:
1 <= x <= 60Response
Successful Response
⌘I
Get Upload Url
curl --request POST \
--url https://api.diginacape.co.ke/documents/api/v1/documents/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"content_type": "<string>",
"document_category": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"description": "<string>",
"tags": "<string>",
"is_public": false,
"allowed_departments": "<string>",
"allowed_users": "<string>",
"allowed_roles": "<string>",
"expires_minutes": 15
}
'import requests
url = "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url"
payload = {
"filename": "<string>",
"content_type": "<string>",
"document_category": "<string>",
"resource_type": "<string>",
"resource_id": "<string>",
"description": "<string>",
"tags": "<string>",
"is_public": False,
"allowed_departments": "<string>",
"allowed_users": "<string>",
"allowed_roles": "<string>",
"expires_minutes": 15
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
content_type: '<string>',
document_category: '<string>',
resource_type: '<string>',
resource_id: '<string>',
description: '<string>',
tags: '<string>',
is_public: false,
allowed_departments: '<string>',
allowed_users: '<string>',
allowed_roles: '<string>',
expires_minutes: 15
})
};
fetch('https://api.diginacape.co.ke/documents/api/v1/documents/upload-url', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>',
'content_type' => '<string>',
'document_category' => '<string>',
'resource_type' => '<string>',
'resource_id' => '<string>',
'description' => '<string>',
'tags' => '<string>',
'is_public' => false,
'allowed_departments' => '<string>',
'allowed_users' => '<string>',
'allowed_roles' => '<string>',
'expires_minutes' => 15
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diginacape.co.ke/documents/api/v1/documents/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.diginacape.co.ke/documents/api/v1/documents/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.diginacape.co.ke/documents/api/v1/documents/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document_category\": \"<string>\",\n \"resource_type\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"description\": \"<string>\",\n \"tags\": \"<string>\",\n \"is_public\": false,\n \"allowed_departments\": \"<string>\",\n \"allowed_users\": \"<string>\",\n \"allowed_roles\": \"<string>\",\n \"expires_minutes\": 15\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}