Documentation
API
Organization API
Fetch an organization, its projects and its members with the WebTranslateIt Organization API.
2 min read
The Organization API is composed of 1 endpoint:
Show Organization
This endpoint is accessible by the read-write Organization API key which you can find in your organization settings. It returns information about your organization:
- Organization name,
- A list of projects of the organization with their read-only and read-write API tokens,
- A list of collaborators of the organization.
- A list of teams of the organization.
The call should be made using a GET request.
/api/organizations/:organization_token.format [GET]
Where format is one of xml, json or yaml.
GET
/api/organizations/:organization_token.jsoncurl "https://webtranslateit.com/api/organizations/ORGANIZATION_TOKEN.json"
const response = await fetch(
'https://webtranslateit.com/api/organizations/ORGANIZATION_TOKEN.json'
)
const { organization } = await response.json()
import requests
response = requests.get(
"https://webtranslateit.com/api/organizations/ORGANIZATION_TOKEN.json"
)
organization = response.json()["organization"]
require 'net/http'
require 'json'
uri = URI('https://webtranslateit.com/api/organizations/ORGANIZATION_TOKEN.json')
organization = JSON.parse(Net::HTTP.get(uri))['organization']
<?php
$ch = curl_init('https://webtranslateit.com/api/organizations/ORGANIZATION_TOKEN.json');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$organization = json_decode(curl_exec($ch), true)['organization'];
curl_close($ch);
Data structure in JSON:
json
{
"organization": {
"name": "Atelier Convivialit\u00e9",
"id": 1,
"created_at": "2009-10-14T18:43:02Z",
"updated_at": "2016-09-27T13:39:53Z",
"projects": [{
"name": "Human Markdown Reference",
"id": 386,
"private_api_token": "[redacted]",
"public_api_token": "[redacted]",
"created_at": "2010-01-26T21:27:18Z",
"updated_at": "2013-06-28T10:29:45Z",
"segments_count": 35
}, {
"name": "Redmine",
"id": 396,
"private_api_token": "[redacted]",
"public_api_token": "[redacted]",
"created_at": "2010-02-04T11:07:16Z",
"updated_at": "2017-03-27T22:00:06Z",
"segments_count": 824
}, {
"name": "VLC",
"id": 399,
"private_api_token": "[redacted]",
"public_api_token": "[redacted]",
"created_at": "2010-02-05T14:10:48Z",
"updated_at": "2011-10-17T14:17:01Z",
"segments_count": 5118
}, {
"name": "WebTranslateIt",
"id": 406,
"private_api_token": "[redacted]",
"public_api_token": "[redacted]",
"created_at": "2010-02-09T23:23:11Z",
"updated_at": "2017-04-04T15:22:37Z",
"segments_count": 2647
}],
"collaborators": [ {
"id": 1,
"name": "Firstname Lastname",
"email": "email@webtranslateit.com",
"created_at": "2010-01-13T00:45:21Z",
"updated_at": "2010-01-13T00:45:21Z",
"admin": true
}, {
"id": 2,
"name": "Chonchon",
"email": "chonchon@webtranslateit.com",
"created_at": "2009-10-14T18:43:02Z",
"updated_at": "2010-04-22T20:57:37Z",
"admin": null
}],
"teams": [{
"id": 1,
"name": "The A Team!",
"description": "I\u2019ve had a few teams, but this is my best team",
"created_at": "2017-03-29T13:19:09Z",
"updated_at": "2017-04-03T09:05:31Z",
"projects": [{
"id": 386
}, {
"id": 399
}, {
"id": 406
}]
}, {
"id": 4,
"name": "The B Team 2",
"description": "Not my best team but they will do!!!",
"created_at": "2017-04-03T16:42:07Z",
"updated_at": "2017-04-03T16:46:52Z",
"projects": [{
"id": 406
}]
}]
}
}
Each project in the response carries its own private_api_token and public_api_token, which are
the read-write and read-only Project API tokens the rest of these docs call PROJECT_TOKEN.