REST API v1

Projects

GET /projects List all your projects, including your own and projects you collaborate with.
GET /:account/projects/:project Displays the project specified including links to all further linked resources (e.g. resource files) and links to more actions that can be called.

Resources (List, Download & Upload)

GET /:account/projects/:project/resources Display resource files for the project specified.
GET /:account/projects/:project/resources/:filename Download a file for the specified resources’ generated content.
POST /:account/projects/:project/resources Upload the resource file and import the file contents into the LingoHub project

Sessions

POST /sessions An authentication token will be returned after the user credentials have been authenticated.

Authentication

LingoHub offers two authentication methods with our API:

  1. Token Authentication
  2. HTTP Authentication

The two methods of authentication are supported equally. If you wish to change your authentication details (username, email, password, token) you can do so on your Account Settings page.

Token Authentication

You can add the URL parameter ‘auth_token’ to your request for authentication. You can find your API token value your API on your Account Settings page.

curl -X GET https://api.lingohub.com/v1/projects.json?auth_token=cb26a0249f6953a...

HTTP Authentication

HTTP supports the use of several authentication mechanisms to control access to pages and other resources. These mechanisms are all based around the use of the 401 status code and the WWW-Authenticate response header. The client sends the username and password as unencrypted, base64-encoded text. Because it is unencrypted, it should only be used with HTTPS, as the password can be easily captured and reused over HTTP.
Luckily, LingoHub encrypts all communication with SSL.

curl -X GET https://api.lingohub.com/v1/projects.json -u [email protected]:password

HTTP Status Codes

For each request LingoHub API tries to return suitable HTTP status codes. Response codes for the REST API can be suppressed.

  • 200 OK: Success!
  • 304 Not Modified: No new data was found.
  • 400 Bad Request: Your request was not valid. There will be an explanatory error message. This is the status code; during rate limiting it will be returned
  • 401 Unauthorized: There are missing or incorrect authentication credentials.
  • 403 Forbidden: Your request was understood, but it has been refused. There will be an explanatory error message.This code is used when requests are being refused due to update limits.
  • 404 Not Found: The URI requested is not valid or the requested resource, a user for example, does not exist.
  • 406 Not Acceptable: If an invalid format is specified in the request the search API will return this code.
  • 500 Internal Server Error: Please inform the LingoHub Support team who will investigate as something is damaged.

Error Messages

When the LingoHub API returns error messages, it does so in your requested format. For example, an error from a JSON method might look like this:

{"error": "The 'page_size' parameter must be between 1 and 100 but was -1"}

Request Rate Limiting

To protect LingoHub from abuse the API usage is rate-limited, with additional fair use limits.



Was this Helpful ?   yes     no Chat with us