From 34dae8128c63082b16c89644df383c7a078c4ae7 Mon Sep 17 00:00:00 2001 From: gliggy Date: Fri, 26 Nov 2021 15:37:00 -0500 Subject: [PATCH] improve docs --- API.md | 34 ++++++++++++++++++++-------------- SERVER.md | 5 +++++ 2 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 SERVER.md diff --git a/API.md b/API.md index eca8767..542fa8c 100644 --- a/API.md +++ b/API.md @@ -1,31 +1,37 @@ -Hello, good evening, and welcome, to makesweet's API! -Here's how to use it: -1. get a computer -2. get curl -3. send a POST request with things in it -4. receive a response -5. do whatever you want with it. +How to use the makesweet api: + + 1. get a computer + 2. get curl + 3. send a POST request with things in it + 4. receive a response + 5. do whatever you want with it. examples (assuming MAKESWEET_API is set as env var): ------- -send only text (use &text for more text) +send only text (use &text for more text): ``` -curl -X POST $MAKESWEET_API/make/heart-locket?text=hello -o hello.gif +curl -H "Authorization: key" -XPOST https://api.makesweet.com/make/heart-locket?text=hello -o hello.gif ``` ------- -send only images (for multiple images, repeat with another -F) +send only images (for multiple images, repeat with another -F): ``` -curl -X POST $MAKESWEET_API/make/heart-locket -F "images[]=@image.jpg" -o animation.gif +curl -H "Authorization: key" -XPOST https://api.makesweet.com/make/heart-locket -F "images[]=@image.jpg" -o animation.gif ``` ------- -send both text and images +send both text and images: ``` -curl -X POST $MAKESWEET_API/make/heart-locket?text=squirrel -F "images[]=@image.jpg" -o animation.gif +curl -H "Authorization: key" -XPOST https://api.makesweet.com/make/heart-locket?text=squirrel -F "images[]=@image.jpg" -o animation.gif ``` ------- -the default is images go before text, use &textfirst=1 to make text go first +send stuff with text border: +``` +curl -H "Authorization: key" -XPOST "https://api.makesweet.com/make/heart-locket?text=a+frog,%0Aa+very,+very+coolfrog&textborder=200" -F images=@frog.jpg -o frog.gif +``` +------- + +the default is images go before text, use &textfirst=1 to make text go first. diff --git a/SERVER.md b/SERVER.md new file mode 100644 index 0000000..408ae3b --- /dev/null +++ b/SERVER.md @@ -0,0 +1,5 @@ +server docs +``` +sudo apt install wkhtmltopdf +sudo apt install curl +```