Skip to content

Instantly share code, notes, and snippets.

@renxida
Last active August 25, 2022 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save renxida/9fc62a224339ce75db8c33ec6ebd8305 to your computer and use it in GitHub Desktop.
Save renxida/9fc62a224339ce75db8c33ec6ebd8305 to your computer and use it in GitHub Desktop.
This is a guid on how to use the napkin api in the commandline to post your thoughts to napkin.one

Guide to Posting to napkin.one using curl and their webhook

First, run send code to mail to get a code.

curl -H 'Content-Type: application/json' -d\
    '{"email" : "your email"}'\
    https://us-central1-deepthoughtworks.cloudfunctions.net/sendCodeToMail

Get your code from your email. It should look like "12345", then fill it into the following request:

Then, use this code to get your uid

curl  -H 'Content-Type: application/json' -d\
    '{"email": "your email", "code": "your code"}'\
    https://us-central1-deepthoughtworks.cloudfunctions.net/confirmCredentialsAndGetUid 

You will receive a uid that looks like "hfE4r8T...7syA3". Remember it and the code you got earlier.

Finally, try sending some text. Remember to fill in the uid and code.

curl  -H 'Content-Type: application/json'\
    -d\
    '{
    "uid" : "your uid",
    "code" : "your code",
    "content" : "It is very convenient to post to napkin using curl",
    "sourceUrl" : "https://curl.se/",
    "integrationType" : "curl"
}'\
    https://us-central1-deepthoughtworks.cloudfunctions.net/addTextToAccount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment