FORMAT: X-1A HOST: https://signpuddle.com/server # SignPuddle 3 API > v3.0.0 Welcome to the SignPuddle 3 API. The API is defined with two types of source, two types of documentation, and a live page of HTML and JavaScript. + Source: [ApiTxt format](../src/index.txt) and [JSON objects](../src/index.json) + Documents: [API Blueprint](../doc/index.md) and [Stand Alone HTML](../doc/index.htm) + Live Page: [API Interface](../api/index.html) and [JavaScript](../api/index.js) The API is divided into several sections. This main document includes all of the sections. Each section is available separately as well. ## HTTP Request Methods The SignPuddle 3 server accepts HTTP request methods of GET, POST, PUT, and DELETE. + GET - retrieve information without altering the server + POST - add information to the server with each request + PUT - update information on the server + DELETE - remove information on the server. ## HTTP Response Statuses The SignPuddle 3 server responds with status codes. ### Success Codes + 200 OK + 201 Created + 202 Accepted + 204 No Content ### Redirect Codes + 300 Multiple Choices + 304 No Modified + 307 Temporary Redirect + 308 Permanent Redirect ### Client Error Codes + 400 Bad Request + 403 Forbidden + 404 Not Found + 409 Conflict + 429 Too Many Requests ### Server Error Codes + 500 Internal Server Error + 501 Not Implemented + 503 Service Unavailable ## HTTP Headers Headers pass additional information about the request or response. ### Headers + Content-Type - the MIME type of the response + ETag - an entity tag used to validate cached values + Expires - date after which response is stale + Location - used for redirect or for newly created resource + If-None-Match - request header compared to ETag value, response status 304 if matching + If-Modified-Since - request header, causes response status 304 if unmodified + Last-Modified - response header, used with If-Modified-Since request header ## Group user SignPuddle 3 collections are organized by country and language codes + Source: [ApiTxt format](../src/user.txt) and [JSON objects](../src/user.json) + Documents: [API Blueprint](../doc/user.md) and [Stand Alone HTML](../doc/user.htm) + Live Page: [API Interface](../api/user.html) and [JavaScript](../api/user.js) ### Who uses SignWriting? [/user/who] List of countries with size and activity. #### Retrieve country list [GET] The available countries where signs are available. + Request user-who + Body null + Response 200 (text/plain) + Body BR US ### User pass [/user/pass] A string for accounting and validation #### String for accounting and validation [POST] + Request user pass + Body null + Response 200 (text/plain) + Body {"pass": "90c19ce2076db097c75b3406e966a6b6","ip": "192.168.254.2"} #### Check pass against user [PUT] + Request user pass verify + Attributes + username: anonymous (string) - name of the user + pass: af77... (string) - pass for session validation + Body {"username":"anonymous","pass":"af77..."} + Response 204 ### User login [/user/login] Validation of user with validated password #### Process log in to server [PUT] + Request verify user (application/json) + Attributes + username: anonymous (string) - name of the user + pass: af77... (string) - pass for session validation + validated: 2793f... (string) - validated pass mixed with password + Body {"username":"anonymous","pass":"af77...","validated":"2793f..."} + Response 200 (application/json) response text here + Body {"user-profile":""} ### User profile [/user/{name}] User details + Parameters + name: slevinski (string) - The name of a user #### Update user profile [PUT] Updates the profile of the user + Request user-update + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 #### Register new user [POST] Creates and returns a new user + Request user-add + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 200 (text/plain) + Body profile created and returned ### User password [/user/{name}/password] User password resource + Parameters + name: slevinski (string) - The name of a user #### Update user password [POST] Updates the password of the user + Request user-update-password (plain/text) + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body {"old":"149603e6c03516362a8da23f624db945","new":"22af645d1859cb5ca6da0c484f1f37ea"} + Response 204 #### Reset user password [PUT] Creates a temporary password for the user + Request user-password-reset (plain/text) + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ### User email requests [/user/email] Requests for email of username or password reset #### List of user email requests [GET] User email requests for username or passwords + Request user-email-request + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 200 (text/plain) + Body [{"name":"slevinski","email":"slevinski@signwriting.org","temp":"username"}] ### Username lookup [/user/email/{email}] Forgot username email lookup + Parameters + email: slevinski@signwriting.org (string) - The email for a user #### Lookup username [PUT] Creates a request for email of username + Request user-name-lookup + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ## Group collection Resources related to collections in general + Source: [ApiTxt format](../src/collection.txt) and [JSON objects](../src/collection.json) + Documents: [API Blueprint](../doc/collection.md) and [Stand Alone HTML](../doc/collection.htm) + Live Page: [API Interface](../api/collection.html) and [JavaScript](../api/collection.js) ### Collections available [/collection{?name}] + Parameters + name: sp3 (string) - partial collection name #### Get available collections [GET] + Response 200 (text/plain) + Body ["en-US-interface-sp3"] ### Collection resource [/collection/{name}] Specific collection + Parameters + name: `en-US-interface-sp3` (string) - The name of a collection #### delete collection [DELETE] + Request the removal of a collection + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ### Collection entry image resource [/collection/{name}/entry/{ik}/image/{num}] Specific image for collection entry + Parameters + name: `ase-US-dictionary-public` (string) - The name of an dictionary + ik: 11244 (string) - An id number or key string + num: 1 (string) - The image number of 1 thru 4 #### update image for collection entry [PUT] + Request an update for an existing dictionary entry (application/json) + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body { "file": "name.png", "data": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD..." } + Response 204 #### remove dictionary entry [DELETE] + Request the removal of a collection entry image + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body null + Response 204 ### Collection statistics [/collection/{name}/stats] Statistics about the collection + Parameters + name: `ase-US-dictionary-public` (required,string) - The name of a dictionary #### Get collection statistics [GET] + Request collections statistics + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z + Body null + Response 200 (text/plain) + Body [{"name": "en-US-interface-sp3","code": "ui1","title": "English Interface for SignPuddle 3","user": "slevinski","created_at": "","view_pass": 0,"add_pass": 1,"edit_pass": 1,"register_level": 0,"upload_level": 4}] ### Collections security [/collection/security] Security settings for all collections #### Get collections security [GET] + Request collections security + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z + Body null + Response 200 (text/plain) + Body [{"name": "en-US-interface-sp3","code": "ui1","title": "English Interface for SignPuddle 3","user": "slevinski","created_at": "","view_pass": 0,"add_pass": 1,"edit_pass": 1,"register_level": 0,"upload_level": 4}] ### Collection security [/collection/{name}/security] Details about the collection security + Parameters + name: `en-US-interface-sp3` (required,string) - The name of the collection #### retrieve collection security [GET] + Request interface security + Body null + Response 200 (text/plain) + Body {"name": "en-US-interface-sp3","code": "ui1","title": "English Interface for SignPuddle 3","user": "slevinski","created_at": "","view_pass": 0,"add_pass": 1,"edit_pass": 1,"register_level": 0,"upload_level": 4} #### Update collection security [PUT] + Request an update for an existing entry (text/plain) + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body {"name": "en-US-interface-sp3","code": "ui1","title": "English Interface for SignPuddle 3","user": "slevinski","created_at": "","view_pass": 0,"add_pass": 1,"edit_pass": 1,"register_level": 0,"upload_level": 4} + Response 204 #### Remove security for collection [DELETE] + Request the deletion of collection security + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ### Collection users [/collection/{name}/users] + Parameters + name: `ase-US-dictionary-public` (string) - collection name #### Get collection users [GET] + Response 200 (text/plain) + Body [{"user": "test_user","security": 3}] ### Management for unknown collections [/collection/manage/unknown] #### Get list of unknown collections with user management [GET] + Response 200 (text/plain) + Body ["es-US-interface-sp3"] ### Collection users management [/collection/{name}/manage] + Parameters + name: `ase-US-dictionary-public` (string) - collection name #### Get collection management [GET] + Request collection management + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 200 (text/plain) + Body [{"name": "test_user","display": "Test Editor","email": "testing@gmail.com","security": 3}] #### Update collection management [PUT] + Request an update for collection management + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body {"user":"slevinski","security":4} + Response 204 #### Remove user management for collection [DELETE] + Request the removal of user management for a collection + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ### Collection user [/collection/{name}/manage/{user}] + Parameters + name: `ase-US-dictionary-public` (string) - collection name + user: `slevinski` (string) - user name #### Remove user from collection management [DELETE] + Request the removal of a user from collection management + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ### Collection Request Copy [/collection/{name}/request/{source}] + Parameters + name: `es-US-interface-sp3` (required,string) - The name of the new collection + source: `en-US-interface-sp3` (required,string) - The name of the source collection #### request the creation of a new collection [POST] + Request new collection from source + Headers Pass: 5ffab638bde372b4fa63bb6f8484595d + Body null + Response 204 ## Group interface Resources related to interface collections + Source: [ApiTxt format](../src/interface.txt) and [JSON objects](../src/interface.json) + Documents: [API Blueprint](../doc/interface.md) and [Stand Alone HTML](../doc/interface.htm) + Live Page: [API Interface](../api/interface.html) and [JavaScript](../api/interface.js) ### Interfaces available [/interface{?name}] + Parameters + name: sp3 (string) - partial interface name #### Get available interfaces [GET] + Response 200 (text/plain) + Body ["en-US-interface-sp3"] ### Interface resource [/interface/{name}{?update}] Access to available interfaces + Parameters + name: `en-US-interface-sp3` (required,string) - The name of an interface + update: 1 (optional,number) - Forces a rewrite of the interface for json and txt formats #### retrieve interface [GET] + Request interface text + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z + Body null + Response 200 (text/plain) + Body print.buttons.main message description icon ### Interface keys [/interface/{name}/key] Access to interface keys + Parameters + name: `en-US-interface-sp3` (required,string) - The name of an interface #### retrieve interface keys [GET] + Request interface keys + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body null + Response 200 (text/plain) + Body ["print.buttons.main"] ### Interface entries search [/interface/{name}/search/{text}] Search interface for text + Parameters + name: `en-US-interface-sp3` (required,string) - The name of an interface + text: `SignPuddle` (required,string) - The text for searching #### retrieve matching entries [GET] + Request matching interface entries + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body null + Response 200 (text/plain) + Body [ { "key": "print.buttons.main", "message": "Print it!" } ] ### Interface entry resource [/interface/{name}/entry] Entries for interface + Parameters + name: `en-US-interface-sp3` (string) - The name of an interface #### add interface entry [POST] + Request add new interface entry (application/json) + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body {"key":"new.key.one", "message":"UI text","description":"about the text","icon":"search"} + Response 201 (text/plain) + Body ... ### Interface entry resource for key [/interface/{name}/entry/{key}] Specific entries for interface + Parameters + name: `en-US-interface-sp3` (string) - The name of an interface + key: system.button.open (string) - The name of an interface key #### retrieve interface entry [GET] + Request an interface entry + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body null + Response 200 (text/plain) + Body ... #### update interface entry [PUT] + Request an update for an existing entry + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body {"key":"new.key.one", "message":"UI text","description":"about the text","icon":"search"} + Response 204 #### remove interface entry [DELETE] + Request the removal of an interface entry + Headers Pass: 724fd4b4438fba9d0c5ab89d0833e5c9 + Body null + Response 204 ## Group dictionary Resources related to dictionary collections + Source: [ApiTxt format](../src/dictionary.txt) and [JSON objects](../src/dictionary.json) + Documents: [API Blueprint](../doc/dictionary.md) and [Stand Alone HTML](../doc/dictionary.htm) + Live Page: [API Dictionary](../api/dictionary.html) and [JavaScript](../api/dictionary.js) ### Dictionaries available [/dictionary{?name}] + Parameters + name: public (string) - partial dictionary name #### Get available dictionaries [GET] + Response 200 (text/plain) + Body ["ase-US-dictionary-public"] ### Dictionary resource [/dictionary/{name}{?update}] Access to available dictionaries + Parameters + name: `ase-US-dictionary-public` (required,string) - The name of an dictionary + update: 1 (optional,number) - Forces a rewrite of the dictionary for json and txt formats #### retrieve dictionary [GET] + Request dictionary text + Headers If-Modified-Since: 2019-01-16T16:56:19.175Z + Body null + Response 200 (text/plain) + Body 1 𝠀ρ‚±‘ρ‚‡™ρ†Ώƒπ ƒπ€π€”ρ‚‡™π£°π£Ήρ†Ώƒπ€Žπ€ρ‚±‘𝣽𝀀 test zero test zero we are testing SignPuddle 1.6 Val ;-) {"video":"