Francisco Posted December 23, 2019 Share Posted December 23, 2019 Hello there group! I am developing an app using the webservice API. Among other data, I need to fetch the images, for which I get URLs that require authentication. Now, browser is blocking the requests including the API key in the URL (see attached image). Wondering now: is there any way to get some URL to the same image that does not require authentication? Thanks in advance for your time! Cheers! Link to comment Share on other sites More sharing options...
tomerg3 Posted December 27, 2019 Share Posted December 27, 2019 What kind of authentication is required? Images should not have any authentication to them, they should be accessible in any browser Link to comment Share on other sites More sharing options...
Francisco Posted December 28, 2019 Author Share Posted December 28, 2019 When getting the images of the product from the webservice, the URLs I am getting look like this: http://35.183.101.48/api/images/products/15/23 When trying to load this URL from a different browser I get this credentials request: That is why I included the credentials in the URL to be loaded by the browser in this fashion: http://<API_KEY_HERE>@35.183.101.48/api/images/products/15/23 But when doing so, I am getting errors in the browser: So, is there any way to get some URL to the same image that does not require authentication? Thanks in advance for your time! Cheers! Link to comment Share on other sites More sharing options...
tomerg3 Posted December 30, 2019 Share Posted December 30, 2019 I haven't really worked with the API, but it looks like it's looking for both a user and a password. If the site is functional, you should be able to compare a URL of an image and get it from the working site, but I would try to figure out the API. Are you able to manually login by entering the credentials in the browser? Link to comment Share on other sites More sharing options...
Francisco Posted December 30, 2019 Author Share Posted December 30, 2019 Hello Tomerg3, Comparing won't help: http://99.79.43.35/api/image/23 http://99.79.43.35/23-large_default/pack-mug-framed-poster.jpg ☝️There is a non predictable part in the URL. Entering manually the credentials is not an option at the moment. Is there a specific forum for the API usage where I can get further details on how to solve this? Thanks for your support! Link to comment Share on other sites More sharing options...
tomerg3 Posted December 30, 2019 Share Posted December 30, 2019 All images are accessible without a rewrite URL, they are in /img/p/productid/productid.jpg You don't need to manually enter the credentials, you just need the correct user+password and use them in the URL as described in the error you saw http://USER:PASS@IPaddress Link to comment Share on other sites More sharing options...
pedepot Posted December 31, 2019 Share Posted December 31, 2019 You need to authenticate your application every time you try to connect to Prestashop API. There is a sample code at https://github.com/PrestaShop/PrestaShop-webservice-lib/blob/master/PSWebServiceLibrary.php I hope it helps Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now