curl --request PUT \
--url https://api-dev.narrative.io/company/{company_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": null,
"visibility": "visible",
"status": "active",
"website": null
}
'import requests
url = "https://api-dev.narrative.io/company/{company_id}"
payload = {
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": None,
"visibility": "visible",
"status": "active",
"website": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'ACM',
slug: 'acm',
long_description: 'The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.',
short_description: 'American Company that Manufactures Everything',
contact_email: '[email protected]',
twitter_link: 'https://twitter.com/acm_company',
linkedin_link: 'https://www.linkedin.com/company/acm_company',
image_url: null,
visibility: 'visible',
status: 'active',
website: null
})
};
fetch('https://api-dev.narrative.io/company/{company_id}', 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-dev.narrative.io/company/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'ACM',
'slug' => 'acm',
'long_description' => 'The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.',
'short_description' => 'American Company that Manufactures Everything',
'contact_email' => '[email protected]',
'twitter_link' => 'https://twitter.com/acm_company',
'linkedin_link' => 'https://www.linkedin.com/company/acm_company',
'image_url' => null,
'visibility' => 'visible',
'status' => 'active',
'website' => null
]),
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-dev.narrative.io/company/{company_id}"
payload := strings.NewReader("{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-dev.narrative.io/company/{company_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}"
response = http.request(request)
puts response.read_body{
"company_id": 42,
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": null,
"visibility": "visible",
"status": "active",
"website": null,
"created_at": "2016-06-09T02:00:47Z",
"created_by": "[email protected]",
"last_updated_at": "2023-08-17T16:18:10.386058Z",
"last_updated_by": "[email protected]"
}Update a company
Update the company. Please note that “slug” could be changed only once (from null to some value). Lack of slug (in the request) considered as change to null and passes validation if current value is null too. Status can be changed from pending to active but not in the opposite direction.
curl --request PUT \
--url https://api-dev.narrative.io/company/{company_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": null,
"visibility": "visible",
"status": "active",
"website": null
}
'import requests
url = "https://api-dev.narrative.io/company/{company_id}"
payload = {
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": None,
"visibility": "visible",
"status": "active",
"website": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'ACM',
slug: 'acm',
long_description: 'The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.',
short_description: 'American Company that Manufactures Everything',
contact_email: '[email protected]',
twitter_link: 'https://twitter.com/acm_company',
linkedin_link: 'https://www.linkedin.com/company/acm_company',
image_url: null,
visibility: 'visible',
status: 'active',
website: null
})
};
fetch('https://api-dev.narrative.io/company/{company_id}', 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-dev.narrative.io/company/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'ACM',
'slug' => 'acm',
'long_description' => 'The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.',
'short_description' => 'American Company that Manufactures Everything',
'contact_email' => '[email protected]',
'twitter_link' => 'https://twitter.com/acm_company',
'linkedin_link' => 'https://www.linkedin.com/company/acm_company',
'image_url' => null,
'visibility' => 'visible',
'status' => 'active',
'website' => null
]),
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-dev.narrative.io/company/{company_id}"
payload := strings.NewReader("{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api-dev.narrative.io/company/{company_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dev.narrative.io/company/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"ACM\",\n \"slug\": \"acm\",\n \"long_description\": \"The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.\",\n \"short_description\": \"American Company that Manufactures Everything\",\n \"contact_email\": \"[email protected]\",\n \"twitter_link\": \"https://twitter.com/acm_company\",\n \"linkedin_link\": \"https://www.linkedin.com/company/acm_company\",\n \"image_url\": null,\n \"visibility\": \"visible\",\n \"status\": \"active\",\n \"website\": null\n}"
response = http.request(request)
puts response.read_body{
"company_id": 42,
"name": "ACM",
"slug": "acm",
"long_description": "The Acme Corporation is an ironic name for the fictional corporation, appearing in the Road Runner/Wile E. Coyote animated shorts, where it was used as a running gag.",
"short_description": "American Company that Manufactures Everything",
"contact_email": "[email protected]",
"twitter_link": "https://twitter.com/acm_company",
"linkedin_link": "https://www.linkedin.com/company/acm_company",
"image_url": null,
"visibility": "visible",
"status": "active",
"website": null,
"created_at": "2016-06-09T02:00:47Z",
"created_by": "[email protected]",
"last_updated_at": "2023-08-17T16:18:10.386058Z",
"last_updated_by": "[email protected]"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The id of an existing company
Body
Unique identifier of an existing company.
7
Name of the company
Name of the company
A short description of the company
The complete description of the company
The url of the logo of the company
The geographical location of the company
The number of employees
The url of the website of the company
Email contact
Twitter account
LinkedIn account
invisible, visible, invisible_in_discover active, deleted, pending Response
OK
Unique identifier of an existing company.
7
Name of the company
Unique id for the company
A short description of the company
The complete description of the company
The url of the logo of the company
The geographical location of the company
The number of employees
The url of the website of the company
Email contact
Twitter account
LinkedIn account
The instant this company was created.
"2021-06-24T00:54:40.029056Z"
Contact of user who created the company
The instant this company was created.
"2021-06-24T00:54:40.029056Z"
Contact of user who updated the company
invisible, visible, invisible_in_discover active, deleted, pending Was this page helpful?

