ACINQ / phoenixd

https://phoenix.acinq.co/server
Apache License 2.0
111 stars 14 forks source link

API authentication request returns nothing #4

Closed bitkarrot closed 7 months ago

bitkarrot commented 7 months ago

According to the documentation when attempting to access the API, with this example, and replacing the key in the example below OjgxZWEy...2RlZmI= with the Password for the http api from the config file -> (default: reads from /Users//.phoenix/phoenix.conf),

There is no response returned on the command line when entering the password from phoenix.conf

$ curl --location 'http://localhost:9740/getinfo' \
    --header 'Authorization: Basic OjgxZWEy...2RlZmI='

Are we supposed to modify the authorization password somewhere before passing it into following curl command?

Please advise if we are using the command incorrectly or if we should be using the authorization key from somewhere else.

Thanks in advance.

bitkarrot commented 7 months ago

Wait, does the API only work if there is a channel open?

pm47 commented 7 months ago

Hi, try this: curl -u :<password> http://.../getinfo

Le dim. 24 mars 2024, 07:37, Bitkarrot @.***> a écrit :

Wait, does the API only work if there is a channel open?

— Reply to this email directly, view it on GitHub https://github.com/ACINQ/phoenixd/issues/4#issuecomment-2016711434, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPPFPVC5KIU5OIY7TIX4VTYZZYBRAVCNFSM6AAAAABFFM3GR6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWG4YTCNBTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

bitkarrot commented 7 months ago

ok thanks. @pm47

jesuspirate commented 7 months ago

nah I think @bitkarrot wanted to report the issue with the createinvoice api call instead: doculink here.

When running the command, it returns nothing...and it should return the following as described in the doc, but it doesn't:


{
    "amountSat": 100,
    "paymentHash": "f419207c9edde9021ebfb6bd0df6bd0a6606ecaf935357cc2f362e30835c3765",
    "serialized": "lntb1u1pjlsjnqpp57svjqly7mh5sy84lk67sma4apfnqdm90jdf40np0xchrpq6uxajscqpjsp592kp0fs2ssgpq9h54tsfaj5w34287v8fezgaw6cr56f076c05glq9q7sqqqqqqqqqqqqqqqqqqqsqqqqqysgqdq6d4ujqenfwfehggrfdemx76trv5mqz9grzjqwfn3p9278ttzzpe0e00uhyxhned3j5d9acqak5emwfpflp8z2cnflcyamh4dcuhwqqqqqlgqqqqqeqqjqnjpjvnv0p3wvwc6vhzkkgm8kl9r837x4p9qupk5ln5tqlm7prrlsy5xd8cf5agae64f53dvm9el0z5hvgcnta4stgmrg7zwfah0nqrqph4ts8l"
}

Let me know if I'm wrong. The getinfo returns something, just no channels mentioned.

pm47 commented 7 months ago

The doc should be simplified to: curl -X POST -u :<password> -d 'description=my first invoice' -d 'amountSat=100' http://127.0.0.1:9740/createinvoice

bitkarrot commented 7 months ago

In general, If the auth isn't working there should be an appropriate error message returned instead of nothing.

Are the docs in a separate repo? Can we make PRs against it?

Thanks in advance. @pm47

dpad85 commented 7 months ago

The documentation page on the website has been updated, it should be easier to use now. Closing this issue, feel free to re-open if you still have problems.

pm47 commented 7 months ago

In general, If the auth isn't working there should be an appropriate error message returned instead of nothing.

Fixed in 4aa7f73

Are the docs in a separate repo? Can we make PRs against it?

Not currently, might change in the future

bitkarrot commented 7 months ago

@pm47 @dpad85

I would still like to see a working example using the headers, if possible as I'm working on an integration with it right now