live_help Notes

chrome_reader_mode This resource is paginated by 30 items

settings Params

Param name Description
filter optional . Must be one of: id, translatable_id, translatable_type, language_id, fields, created_at, updated_at, user_id, default, up_to_date, translations_structure_id.

Filtering on one or more fields

Example:

To filter on translations with the id field matching a_value or another_value:

...&filter[id]=a_value,another_value

Filterable fields:
  • id (standard field)
  • translatable_id (standard field)
  • translatable_type (standard field)
  • language_id (standard field)
  • fields (standard field)
  • created_at (standard field)
  • updated_at (standard field)
  • user_id (standard field)
  • default (standard field)
  • up_to_date (standard field)
  • translations_structure_id (standard field)
page optional . Must be a Hash

The pagination params, as a hash

page[number] optional . Must be Fixnum

The current page

page[size] optional . Must be Fixnum

The number of items per page, defaults to 30, maximum 100

comments powered by <span class='logo-disqus'>Disqus</span>
GET /v2/translations
200
[
  {
    "id": 1,
    "translatable_id": 1,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "Joburg-Final-Exam",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.699Z",
    "updated_at": "2017-11-22T13:40:59.716Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  },
  {
    "id": 2,
    "translatable_id": 2,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "Friends with Benefits",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.747Z",
    "updated_at": "2017-11-22T13:40:59.759Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  },
  {
    "id": 3,
    "translatable_id": 3,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "GBmu",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.783Z",
    "updated_at": "2017-11-22T13:40:59.795Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  }
]
curl  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" "https://api.intra.42.fr/v2/translations"

[
  {
    "id": 1,
    "translatable_id": 1,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "Joburg-Final-Exam",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.699Z",
    "updated_at": "2017-11-22T13:40:59.716Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  },
  {
    "id": 2,
    "translatable_id": 2,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "Friends with Benefits",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.747Z",
    "updated_at": "2017-11-22T13:40:59.759Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  },
  {
    "id": 3,
    "translatable_id": 3,
    "translatable_type": "Tag",
    "language_id": 2,
    "fields": {
      "name": "GBmu",
      "description": null
    },
    "created_at": "2017-11-22T13:40:59.783Z",
    "updated_at": "2017-11-22T13:40:59.795Z",
    "user_id": null,
    "default": true,
    "up_to_date": true,
    "translations_structure_id": 11,
    "translations_structure": {
      "id": 11,
      "searchable_by": [
        "name"
      ],
      "identified_by": [
        "name"
      ],
      "structures_kind": "simple",
      "up_to_date": true,
      "fields_organisation": {
        "name": "string",
        "description": "text"
      },
      "type_name": "Tag",
      "created_at": "2017-11-22T13:40:59.444Z",
      "updated_at": "2017-11-22T13:40:59.444Z"
    }
  }
]
require "oauth2"
UID = "Your application uid"
SECRET = "Your application secret"
client = OAuth2::Client.new(UID, SECRET, site: "https://api.intra.42.fr")
token = client.client_credentials.get_token

response = token.get("/v2/translations")
response.status
# => 200
response.parsed
# => [{"id"=>1, "translatable_id"=>1, "translatable_type"=>"Tag", "language_id"=>2, "fields"=>{"name"=>"Joburg-Final-Exam", "description"=>nil}, "created_at"=>"2017-11-22T13:40:59.699Z", "updated_at"=>"2017-11-22T13:40:59.716Z", "user_id"=>nil, "default"=>true, "up_to_date"=>true, "translations_structure_id"=>11, "translations_structure"=>{"id"=>11, "searchable_by"=>["name"], "identified_by"=>["name"], "structures_kind"=>"simple", "up_to_date"=>true, "fields_organisation"=>{"name"=>"string", "description"=>"text"}, "type_name"=>"Tag", "created_at"=>"2017-11-22T13:40:59.444Z", "updated_at"=>"2017-11-22T13:40:59.444Z"}}, {"id"=>2, "translatable_id"=>2, "translatable_type"=>"Tag", "language_id"=>2, "fields"=>{"name"=>"Friends with Benefits", "description"=>nil}, "created_at"=>"2017-11-22T13:40:59.747Z", "updated_at"=>"2017-11-22T13:40:59.759Z", "user_id"=>nil, "default"=>true, "up_to_date"=>true, "translations_structure_id"=>11, "translations_structure"=>{"id"=>11, "searchable_by"=>["name"], "identified_by"=>["name"], "structures_kind"=>"simple", "up_to_date"=>true, "fields_organisation"=>{"name"=>"string", "description"=>"text"}, "type_name"=>"Tag", "created_at"=>"2017-11-22T13:40:59.444Z", "updated_at"=>"2017-11-22T13:40:59.444Z"}}, {"id"=>3, "translatable_id"=>3, "translatable_type"=>"Tag", "language_id"=>2, "fields"=>{"name"=>"GBmu", "description"=>nil}, "created_at"=>"2017-11-22T13:40:59.783Z", "updated_at"=>"2017-11-22T13:40:59.795Z", "user_id"=>nil, "default"=>true, "up_to_date"=>true, "translations_structure_id"=>11, "translations_structure"=>{"id"=>11, "searchable_by"=>["name"], "identified_by"=>["name"], "structures_kind"=>"simple", "up_to_date"=>true, "fields_organisation"=>{"name"=>"string", "description"=>"text"}, "type_name"=>"Tag", "created_at"=>"2017-11-22T13:40:59.444Z", "updated_at"=>"2017-11-22T13:40:59.444Z"}}]