dashed-slug.net › Forums › General discussion › JSON-API authentication
Tagged: api key, authentication, curl, json api, wallets6
- This topic has 9 replies, 2 voices, and was last updated 4 years, 2 months ago by d3vnu77.
-
AuthorPosts
-
September 8, 2020 at 6:46 pm #9240d3vnu77Participant
We are attempting to build an app wallet with your API and are trying to login and receive a token using the following plugin:
We are having trouble getting past anything that requires authentication.
Can you take a look at the screenshot and give me an idea on what we need to do?
Attachments:
You must be logged in to view attached files.September 9, 2020 at 4:23 am #9244alexgKeymasterHello,
The plugin you mentioned is for giving you access to the WP RESTful API.
Current versions of Bitcoin and Altcoin Wallets implement the JSON-API with custom code, not via the WP REST API.
You should follow the instructions given in the manual, under “APIs, APIs everywhere!” -> “Wallets JSON API” -> “Programmatic access to the Transactions API”. You can get the manual in PDF form if you get the bundle download of the plugin from this website. The trick is to pass the user-specific key via the
__wallets_api_key
GET parameter, or via a bearer authorization HTTP header. Examples usingcurl
are given in the documentation.P.S. As a sidenote, I am currently developing Bitcoin and Altcoin Wallets 6.0.0, which is a complete rewrite of all the code of the plugin and its extensions and adapters. This is an effort that will take several months and will upgrade many aspects of the software suite. One such improvement is that the WP REST API will be used instead of the current JSON-API. When this is out, I will make every effort to provide backwards compatibility via a JSON-API that will be marked as deprecated and will be compatible with version 3 of the current API. Therefore you will not face any unpleasant surprises regarding the app you are building. In any case, I will blog about wallets 6 at a later date, which may be several months into the future. Watch for the release notes of wallets 6, when they become available, before upgrading to this major version of the plugin, because if there is any migration instructions I will make sure to discuss them on the blog. There will be announcements on Facebook, Twitter, the blog, and the RSS feed.
with regards
September 27, 2020 at 4:27 pm #9310d3vnu77ParticipantHi, please you mentioned something like “user-specific key”, can that be gotten from the jwt authentication or is there another way of getting the user key?
September 28, 2020 at 4:56 am #9311alexgKeymasterHello,
To get the JSON-API key remotely, it is necessary to have the user name and password of the user.
To see how to get the API key, please see the following section in the documentation:
“APIs, APIs everywhere!” -> “Wallets JSON API” -> “Programmatic access to the Transactions API” -> “Getting a key”
The documentation showcases how to do this from the shell using curl. You can do this using your language of choice, as long as you can hold cookies between requests.
with regards
October 4, 2020 at 1:28 pm #9337d3vnu77Participantthe authentication is not working in react native and postman but i figured another method to approach the authentication, thanks anyways….
I have another question: please where/how can i get the QR Code, that’s which api holds the QR Code?October 4, 2020 at 1:40 pm #9338d3vnu77Participanti think i found the solution for the QR Code, will get back to you if it didnt work, thanks.
October 5, 2020 at 7:37 am #9341alexgKeymasterHello,
About authentication, it’s not about which library or framework you use. It’s about holding cookies between your curl sessions. Glad you figured it out.
The QR code simply displays the deposit address for each coin. You can get those with the
get_coins_info
JSON-API call. You will need to use a qr code rendering library to create the qr code image from the address.with regards
October 8, 2020 at 10:21 am #9356d3vnu77ParticipantYea i used a library for the QR Code, thanks for your reply anyways.
October 8, 2020 at 11:57 am #9357d3vnu77ParticipantPlease sir, this endpoint /wallets/api3/get_transactions/SYMBOL/COUNT/FROM is not displaying my transactions
October 8, 2020 at 12:01 pm #9358d3vnu77ParticipantSorry i have fixed it, i was doing /wallets/api3/get_transactions/BTC/3/3 not knowing that i added 3 as offset (that’s where to start from) and i dont have upto three transactions
-
AuthorPosts
- You must be logged in to reply to this topic.