Write notes with Helipad. Register →
| Font Size | Body Font | Header Font | Export | ||||
|---|---|---|---|---|---|---|---|
| TXT | HTML | ![]() |
|||||
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:
<pre>
<saved>true</saved>
</pre>
Basic HTTP authentication is required to access the API. Ensure that you use the URL for your account (Ebiwrite accounts have their own subdomain.)
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/titles -u alex@example.com:test
</pre>
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations -u alex@example.com:test
</pre>
Where 1 is the ID of a translation:
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/translations/1/get -u alex@example.com:test
</pre>
<pre style="overflow: scroll; background-color: #ffc">
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
</pre>
Where 1 is the ID of a translation:
<pre style="overflow: scroll; background-color: #ffc">
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
</pre>
This returns a list of files and translations for a given tag:
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/tags/test -u alex@example.com:test
</pre>
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/dictionaries -u alex@example.com:test
</pre>
Where 1 is the ID of a dictionary:
<pre style="overflow: scroll; background-color: #ffc">
curl -X GET -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://alex.ebiwrite.com/dictionaries/1 -u alex@example.com:test
</pre>