Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API problem #7

Open
engr-Eghbali opened this issue Mar 5, 2019 · 6 comments
Open

API problem #7

engr-Eghbali opened this issue Mar 5, 2019 · 6 comments

Comments

@engr-Eghbali
Copy link

Hi.
I used cryptoloot HTTP API like:

https://api.crypto-loot.com/user/balance?name=1256****156&secret=66f5610f5533e9bf****************e84891528dd0
and its responded : { "success": "false", "error": "invalid_secret" }

I copied "exact" key from dashboard. whats wrong?

@Nalem14
Copy link

Nalem14 commented Mar 15, 2019

Send a POST request, don't use GET request.

@engr-Eghbali
Copy link
Author

@Flyingblue
Thanks for your response but cryptoloot documentation said Method: GET.
By the way I tried with 'POST' method and there is no success cause of CORS policy error appeared.

Access to XMLHttpRequest at 'https://api.crypto-loot.com/user/balance' from origin 'http://miner22.dx.am' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

@Nalem14
Copy link

Nalem14 commented Mar 15, 2019

Yes, but is POST.... the documentation said wrong method...
Don't make post request in Javascript, you have a problem with the Origin of the request that is not allowed on other website by a client (js).

Make PHP post request.

<?php
//
// A very simple PHP example that sends a HTTP POST to a remote site
//

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"https://api.crypto-loot.com/user/balance");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('name' => 'user1', 'secret' => 'b1349*****')));

// Receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec($ch);

curl_close ($ch);

// Further processing ...
print_r($server_output);
?>

@engr-Eghbali
Copy link
Author

@Flyingblue Appreciate for your help, it finally worked ! but there is something so strange!
I received response after 3.6 minutes ! why so long?! how is this possible?!

@Nalem14
Copy link

Nalem14 commented Mar 15, 2019

Your welcome ;-)

I don't know, I don't have that problem.
Do you make local test or Server production test ?

@engr-Eghbali
Copy link
Author

@Flyingblue This is server production test, I made a ticket and waiting for support, its unusual .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants