| Body font | Header font | ||
|---|---|---|---|
![]() |
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.
The API will either respond with appropriate XML for the type of object, or a boolean saved status:
<saved>true</saved>
Basic HTTP authentication is required to access the API. Ensure that you use the URL for your account (Ebiwrite accounts have their own subdomain.)
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/titles -u alex@example.com:test
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations -u alex@example.com:test
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
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
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
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
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/dictionaries -u alex@example.com:test
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