The Secret Library API is accessed via https://www.secretlibrary.info/api.php by sending a http POST query.
Index
- Load Deck from Secret Library
- Save Deck to Secret Library
- Export inventory from Secret Library
- Import inventory to Secret Library
Load Deck from Secret Library
Input
sl_deck_retrieve– Tells the Script that a deck is going to be retrieved.sl_user_agent– Name of the user agent retrieving the deck.sl_agent_version– Version details of the user agent.username– Username of the person posting the deck.password– Password of the person posting the deck.deck_id– ID of the deck retrieved.
Output
On success a deck is returned in following format:***SL***TITLE***
NAME OF THE DECK
***SL***AUTHOR***
CREATOR OF THE DECK
***SL***CREATED***
YYYY-MM-DD
***SL***DESCRIPTION***
DESCRIPTION OF THE DECK
MAY SPAN ON MULTIPLE LINES
***SL***CRYPT***
2 Count Germaine
2 Count Germaine (Adv)
2 François Warden Loehr
***SL***LIBRARY***
10 Cloak the Gathering
2 Coven, The
2 Carlton Van Wyk (Hunter)
***SL***ENDDECK***
1: Invalid POST variables– Some or all POST variables were missing.2: Invalid username or password– Username or password given were invalid.4: Invalid user agent– User agent or user agent version were missing, or the user agent has its access restricted.8: Database error: ...– A database error occured.16: Deck not found– Deck ID given isn't found in the database or the user was denied access to the deck.
Save Deck to Secret Library
Input
sl_deck_submit– Tells the Script that a deck is going to be posted.sl_user_agent– Name of the user agent posting the deck.sl_agent_version– Version details of the user agent.username– Username of the person posting the deck.password– Password of the person posting the deck.title– Name of the deck.author– Author of the deck.description– Description of the deck.public– Is the deck posted going to be public (1) or private (0).crypt– Contents of the crypt.library– Contents of the library.
Crypt and Library Format
There are several acceptable formats. You can either give card names one per line ("Count Germaine"),
give the number as a simple number followed by a space ("2 Count Germaine")
or add a generic multiplier marker after the number ("2x Count Germaine" or "2* Count Germaine").
Advanced versions of vampires are notified with an Adv in parenthesis ("(Adv)") after the name separated with a space.
Output
0: Url to deck: https://...– Post was success. API returns notification of success and URL to deck.1: Invalid POST variables– Some or all POST variables were missing.2: Invalid username or password– Username or password given were invalid.4: Invalid user agent– User agent or user agent version were missing, or the user agent has its access restricted.8: Database error: ...– A database error occured.16: Empty crypt– Crypt posted was empty.32: Empty library– Library posted was empty.64: Unknown crypt card: ...– Deck contained an unknown crypt card.124: Unknown library card: ...– Deck contained an unknown library card.
Export inventory from Secret Library
Input
sl_inventory_export– Tells the Script that an inventory is about to be exported.sl_user_agent– Name of the user agent posting the deck.sl_agent_version– Version details of the user agent.username– Username of the person posting the deck.password– Password of the person posting the deck.
Output
On success an inventory is returned in following format:HAVE;WANT;CARD NAME
***SL***CRYPT***
2;2;Abebe
2;2;Alan Sovereign (Adv)
4;3;François Warden Loehr
***SL***LIBRARY***
1;1;Absimiliard's Army
5;5;Ahriman's Demesne
4;4;Atonement
1;1;Textbook Damnation, The
8;8;Watch Commander
***SL***ENDEXPORT***
1: Invalid POST variables– Some or all POST variables were missing.2: Invalid username or password– Username or password given were invalid.4: Invalid user agent– User agent or user agent version were missing, or the user agent has its access restricted.8: Database error: ...– A database error occured.
Import inventory to Secret Library
Input
sl_inventory_import– Tells the Script that an inventory is about to be imported.sl_user_agent– Name of the user agent posting the deck.sl_agent_version– Version details of the user agent.username– Username of the person posting the deck.password– Password of the person posting the deck.inventory_crypt– Crypt inventory.inventory_library– Library inventory.inventory_purge– ***WARNING*** If variable is submitted the old inventory is cleared before saving the new inventory.
2;2;Abebe
2;2;Alan Sovereign (Adv)
4;3;François Warden Loehr
1;1;Absimiliard's Army
5;5;Ahriman's Demesne
4;4;Atonement
1;1;Textbook Damnation, The
8;8;Watch Commander
Output
0: Inventory successfully saved.– Inventory was successfully saved into Secret Library.1: Invalid POST variables– Some or all POST variables were missing.2: Invalid username or password– Username or password given were invalid.4: Invalid user agent– User agent or user agent version were missing, or the user agent has its access restricted.8: Database error: ...– A database error occured.16: Empty crypt– Crypt posted was empty.32: Empty library– Library posted was empty.64: Unknown crypt card: ...– Inventory contained an unknown crypt card.124: Unknown library card: ...– Inventory contained an unknown library card.
For more information contact the developer through the Secret Library forum.