Create a draft story from a Library file
Uses the current tenant and Library/linked-record permissions. Private preferences and collections belong to the current user. Mutations are unavailable in support sessions. Creates an internal, unreviewed story and attaches this file. Requires impact_stories_manage; a matching request_key reuses the draft, while changed content conflicts. Mapped Drive folder program context is inherited. Existing story edits are refused with 409 and must be made in Stories.
curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"request_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": "<string>",
"body": "<string>",
"expected_edit_token": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories"
payload = {
"title": "<string>",
"request_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": "<string>",
"body": "<string>",
"expected_edit_token": "<string>"
}
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({
title: '<string>',
request_key: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
summary: '<string>',
body: JSON.stringify('<string>'),
expected_edit_token: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories', 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.gratona.com/v1/admin/workspace-library/files/{file}/stories",
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([
'title' => '<string>',
'request_key' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'summary' => '<string>',
'body' => '<string>',
'expected_edit_token' => '<string>'
]),
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.gratona.com/v1/admin/workspace-library/files/{file}/stories"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\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.gratona.com/v1/admin/workspace-library/files/{file}/stories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories")
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 \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"title": "<string>",
"summary": "<string>",
"body": "<string>",
"status": "<string>",
"privacy_level": "<string>",
"consent_status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"workspace_url": "<string>",
"can_edit_in_library": true
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}Authorizations
Passport bearer token authentication for legacy admin sessions.
Path Parameters
File.
Body
Request fields accepted by this operation. Omitted optional properties retain the behavior described above.
Validation: required|string|max:255.
255Validation: required|uuid.
Validation: nullable|string|max:5000.
5000Validation: nullable|string|max:50000.
50000Validation: nullable|string|max:255.
255Response
Create a draft story from a Library file response.
Show child attributes
Show child attributes
curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"request_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": "<string>",
"body": "<string>",
"expected_edit_token": "<string>"
}
'import requests
url = "https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories"
payload = {
"title": "<string>",
"request_key": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"summary": "<string>",
"body": "<string>",
"expected_edit_token": "<string>"
}
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({
title: '<string>',
request_key: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
summary: '<string>',
body: JSON.stringify('<string>'),
expected_edit_token: '<string>'
})
};
fetch('https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories', 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.gratona.com/v1/admin/workspace-library/files/{file}/stories",
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([
'title' => '<string>',
'request_key' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'summary' => '<string>',
'body' => '<string>',
'expected_edit_token' => '<string>'
]),
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.gratona.com/v1/admin/workspace-library/files/{file}/stories"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\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.gratona.com/v1/admin/workspace-library/files/{file}/stories")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-library/files/{file}/stories")
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 \"title\": \"<string>\",\n \"request_key\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"summary\": \"<string>\",\n \"body\": \"<string>\",\n \"expected_edit_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"title": "<string>",
"summary": "<string>",
"body": "<string>",
"status": "<string>",
"privacy_level": "<string>",
"consent_status": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"workspace_url": "<string>",
"can_edit_in_library": true
}
}{
"message": "Unauthorized",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"message": "Not Found",
"status": "error"
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}{
"errors": {},
"status": "error",
"message": "The given data was invalid."
}{
"message": "Something went wrong. Please try again.",
"status": "error",
"error": "invalid_request",
"code": "DONOR_NOT_FOUND"
}