Body font Header font  
Print

Ebiwrite REST API

Overview

The Ebiwrite API is XML over HTTP. Simply set the following headers to inform Ebiwrite you want to use XML:

Accept: application/xml Content-Type: application/xml

The examples in this document use curl, a command line utility. You could achieve similar results with wget.

API responses

The API will either respond with appropriate XML for the type of object, or a boolean saved status:

<saved>true</saved>

Authentication

Basic HTTP authentication is required to access the API. Ensure that you use the URL for your account (Ebiwrite accounts have their own subdomain.)

Methods

Translations

Translation title list (/translations/titles)

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/titles -u alex@example.com:test

All translations (/translations)

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations -u alex@example.com:test

Get translation (/translations/1/get)

Where 1 is the ID of a translation:

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/1/get -u alex@example.com:test

Create translation (/translations/create)

curl -X POST -d '<translation><title>Translation title</title><tags>tag1 tag2 tag3</tags><source>Source text</source><translation>Translation text</translation></translation>' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/create -u alex@example.com:test

Update translation (/translations/1/update)

Where 1 is the ID of a translation:

curl -X PUT -d '<translation><title>Translation title</title></translation>' -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/1/update -u alex@example.com:test

Tags

List content by tag (/tags/test)

This returns a list of files and translations for a given tag:

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/tags/test -u alex@example.com:test

Dictionary list (/dictionaries)

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/dictionaries -u alex@example.com:test

Word list (/dictionaries/1)

Where 1 is the ID of a dictionary:

curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/dictionaries/1 -u alex@example.com:test