Organization API

The Organization API is composed of 1 endpoint:

Show Organization

This endpoint is accessible by the 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.

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":"2014-03-20T07:22:13Z",
      "projects":[
         {
            "name":"WebTranslateIt",
            "id":406,
            "private_api_token":"[redacted]",
            "public_api_token":"[redacted]",
            "created_at":"2010-02-09T23:23:11Z",
            "updated_at":"2014-03-19T09:33:49Z",
            "segments_count":2229
         },
         {
            "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":"Test WTIpress",
            "id":2258,
            "private_api_token":"[redacted]",
            "public_api_token":"[redacted]",
            "created_at":"2011-09-09T11:40:30Z",
            "updated_at":"2013-06-28T09:14:05Z",
            "segments_count":8
         },
      ],
      "collaborators":[
         {
            "id":1,
            "name":"\u00c9douard Bri\u00e8re",
            "email":"email@webtranslateit.com",
            "created_at":"2009-10-14T18:43:02Z",
            "updated_at":"2010-04-22T20:57:37Z",
            "admin":true
         },
         {
            "id":11960,
            "name":"Chonchon",
            "email":"chonchon@webtranslateit.com",
            "created_at":"2013-04-22T13:08:44Z",
            "updated_at":"2013-04-22T13:08:44Z",
            "admin":false
         }
      ]
   }
}

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);
?>