• Purchasing a license grants permission to use the software and to get Tech Support. A license purchase doesn't grant customization support.

Awaiting feedback API (?bug)

Gatses

Founder license
License owner
Hello there!

I have some problems with API.
When I try to use it I always geting exception
Invalid base64 string.
with error code 120
I checked code and found this..
Well, i think function !G\timing_sage_compare just comparing 1st and 2nd arguments.. (I didn't see this function)
And i just tried to test this situation:

PHP:
$a = 'aaaaa';
$a1 = base64_decode($a);
$a2 = base64_encode($a1);
print($a);
print('<br/>');
print($a1);
print('<br/>');
print($a2);
And I've got this:

Code:
aaaaa
i¦љ
aaaa
I think 'aaaaa' not equival 'aaaa'..
Am i right? Is it bug? Maybe it caused file encoding problems? At my PC I've got file:

user@pc:~$ file -bi /home/user/chevereto/app/routes/route.api.php
text/x-php; charset=us-ascii

Sorry for my English once again
 

Rodolfo

Chevereto Developer
Chevereto Staff
I've just tested the API in my localhost and it worked. Note that you can use a _FILE multipart or a base64 image encoded string.

To test the API you can so something like this (api.html in the root Chevereto folder):

Code:
<form method="post" action="/api/1/upload/?key=API_KEY_HERE">
    <textarea name="source"></textarea>
    <input type="submit"></submit>
</form>
then get a image base64 string here: http://www.base64-image.de/step-1.php

And it should work. Note that if you use the base64 string as _GET request you will most likely get issues because when you send a get request the data is urlencoded and that affects the base64 string so you should always use _POST when dealing with base64 strings.
 

Rodolfo

Chevereto Developer
Chevereto Staff
API hasn't the bug mentioned. This problem is related to you using the endpoint rather than an error in the endpoint.
 
Top