These examples will use cURL.
Get a snippet with the slug of a
.
curl \
-X GET \ # request method
-u username:password \ # user credentials (get your snippets without password)
-d "password=[password]" \ # unlock with a password
http://drk.sh/s/a # endpoint
Create a new snippet
curl \
-X POST \ # request method
-u username:password \ # user credentials
-d "body=@/path/to/file.txt" \ # snippet body (required)
-d "title=bla" \ # snippet title (required)
-d "mode=markdown" \ # snippet highlight type
-d "password=[password]" \ # protect with a password
http://drk.sh/s # endpoint
You cannot delete snippets through API, yet. Sorry.
Get a file with the slug of a
.
curl \
-X GET \ # request method
-u username:password \ # user credentials (get your snippets without password)
-d "password=[password]" \ # unlock with a password
http://drk.sh/s/a # endpoint
Create a new file
curl \
-X POST \ # request method
-u username:password \ # user credentials
-d "password=[password]" \ # protect with a password
-F "path=@/full/path/to/file" \ # full file path (required)
http://drk.sh/f \ # endpoint
> /path/to/destination/downloaded.md
You cannot delete files through API, yet. Sorry.
Get a url with the slug of a
.
curl \
-X GET \ # request method
-u username:password \ # user credentials (get your snippets without password)
-d "password=[password]" \ # unlock with a password
http://drk.sh/a # endpoint
Create a new url
curl \
-X POST \ # request method
-u username:password \ # user credentials (save within your user)
-d "destination=http://duckduckgo.com" \ # url destination path (required)
-d "password=[password]" \ # protect with a password
http://drk.sh/ # endpoint
You cannot delete URL's through API, yet. Sorry.