March 27, 2019 at 9:35 am #6069
Whats the ugly path for the get_transactions? https://example.com/?__wallets_apiversion=3&__wallets_action=get_transactions how to add these values?: /SYMBOL/COUNT/FROM from the fancy pathMarch 28, 2019 at 11:28 am #6072
About your question regarding transactions, here’s a complete example:
This would retrieve the first 10 BTC transactions. Don’t forget to add authentication parameters to your call.
You can always observe the XHR requests in your browser to see how the plugin does it.
This is where the GET parameters get passed into the PHP API:
And the relevant PHP API:
with regardsApril 10, 2019 at 11:23 am #6116
do you have an ETA when the user_id is reported by the get nonce json call?
PhilippApril 10, 2019 at 11:47 am #6117
Looking into this a bit further:
get_noncesAPI call can by design only be performed by a logged-in user (i.e. with the cookies method, going through wp-login.php). This is typically done by a browser but does not have to be.
My original intention was to be able to display the
[wallets_api_key]shortcode, so that the user is then able to enter it into some other application and grant access. But the user must first login to the website to obtain this information.
I am curious, what your login workflow would be? If the user can already login, what’s the use of having a user_id and key? What type of credential would the user provide to your application via your UI?April 10, 2019 at 11:57 am #6118
as I wrote in the beginning I don’t want to store the login creds on the phone where our app runs on. The initial auth will be via login and then receive the API Key, UserID and nonces. All future requests are made with the API Key. Alternatively (which I would prefer as it is the standard for the most APIs) drop the need of the userID in the JSON API. So the authentication would be only done via the APIKey.
I hope it’S clear what I mean.
PhilippApril 10, 2019 at 12:02 pm #6119
This is an example auth within the app:
This opens the in app browser and lets the user login then the automatic redirect to the get_nonces JSON api happens and the app takes the information and securely stores and encrypts them.April 10, 2019 at 12:06 pm #6120
Dropping the user_id requirement is something that I would like to do, as it is the best solution. I hadn’t found an efficient way to do this yet but it is the correct solution.
As this will go into JSON API 4, I cannot provide an estimate. As a general rule I only provide estimates for defects, not new features, since it is impossible to estimate how long things take.
I will look into how to eliminate the requirement for a user_id argument and let you know.
with regardsApril 10, 2019 at 12:12 pm #6121
Or just add the userID to the get_nonces api key as a little workaround so it’s working in the first place.April 10, 2019 at 3:35 pm #6128
I have modified version 3 of the JSON API in plugin version
__wallets_user_idargument is now ignored. If you specify an API key in your calls, the effective user whose data is returned, is always the user who corresponds to the given API key.
with regardsApril 10, 2019 at 3:47 pm #6130
OK great thanks.
- You must be logged in to reply to this topic.