neveko/docs/curl.md
2023-05-02 03:29:33 -04:00

1.6 KiB

Remote access

NOTE: JWT for micro servers disabled in dev

Login API

  • send with dummy string on first request
  • sign data in the response
  • send second request with signature to get AUTHID and UID
curl -iv -x localhost:9043/login/<SIGNATURE>/<AUTHID>/<UID>

generate invoice

curl -iv  http://bob.b32.i2p/invoice

get contact info

curl -iv  http://bob.b32.i2p/share

generate jwp

curl -iv -X POST http://bob.b32.i2p/prove -d '{"address": "", "confirmations":0,"hash":"", "message":"", "signature": ""}' -H 'Content-Type: application/json'

health check

curl -iv http://bob.b32.i2p/xmr/version -H 'proof: eyJhbGciOiJIUzUxMiJ9...'

add contact

curl -iv -X POST http://localhost:9044/contact -d '{"cid": "KEEP EMPTY", "gpg_key": [1,2,3...], "i2p_address": "", "xmr_address": ""}' -H 'Content-Type: application/json' 

view contacts

curl -iv http://localhost:9044/contacts

send message

curl -ivk http://localhost:9045/tx -d '{"uid":"123", "mid": "", "body": [1,2,3 <PLAINTEXT_BYTES>], "from": "alice.b32.i2p", "created": 0, "to": "bob.b32.i2p"}' -H 'Content-Type: application/json'

receive message

curl -iv http://alice.b32.i2p/message/rx -d '{"uid":"", "mid": "", "body": [1,2,3 <ENCRYPTED_BYTES>], "from": "bob.b32.i2p", "created": 0, "to": "alice.b32.i2p"}' -H 'Content-Type: application/json' -H 'proof: eyJhbGciOiJIUzUxMiJ9...'

view messages

curl -iv http://localhost:9045/messages

decrypt message

curl -iv http://localhost:9045/message/decrypt/<MESSAGE_ID>