Organization API

The Organization API is composed of 1 endpoint:

Show Organization

This endpoint is accessible by the Private 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 public and private 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. Note that you can get a JSONP response by adding a ?callback=yourFunctionName parameter to the json API call.

Data structure in 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
            }]
        }]
    }
}

Implementation Example in Ruby:

require "net/http"
api_key = "sekret"
http = Net::HTTP.new("webtranslateit.com", 443)
http.use_ssl = true
request = Net::HTTP::Get("/api/organizations/#{api_key}")
response = http.request(request)

Implementation Example in PHP:

<?php
  $api_key = "sekret";
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_URL, "https://webtranslateit.com/api/organizations/" . $api_key . ".json");
  $response = curl_exec($ch);
  $p = json_decode($response, true);
  print_r($p);
  curl_close($ch);
?>