Getty Images API Forums

Search

RSS Feed

comp urls got from search api v3 are unaccessible

  1. when searching for images with api v3, most of the urls we receive for comp images leads to: 403 access denied.

    for example, the request: json { "endpoint": "https://connect.gettyimages.com:443/v3/search/images", "method": "GET", "query": { "phrase": "FC Augsburg soccer", "page": 1, "page_size": 10, "fields": "caption,id,display_set,title" }, "headers": { "Authorization": "Bearer ACCESS_TOKEN", "Api-Key": "API_KEY" } } comp images urls received are like this one: http://cache1.asset-cache.net/xc/454376588.jpg?v=1&c=IWSAsset&k=2&d=77BFBA49EF8789215ABF3343C02EA548A290344DDB1EDD4A02B2EE34E84901EE6019474400826983F06BF04B24B4128C which leads to 403 page.

    making the request with api v2, with the same access token and api key gives us accessible urls.

    How can it be solved using api v3?

    Thanks

    Message edited by Sportority_api 2 months ago

  2. Getty Images Paul3 years ago

    Is this still happening for you on V3? We are not able to replicate this issue using your credentials - the URLs returned appear to be working fine.

  3. Sportority_api3 years ago

    ok, apparently the problem occurs only when the first request for the image url from the browser is an ajax request, for example:

    $.get('http://cache4.asset-cache.net/hc/454375834.jpg?v=1&c=IWSAsset&k=2&d=77BFBA49EF8789215ABF3343C02EA548FEA93E96E171AF40C9B37AB894CD632B2CF41DDD200DE0EA')

    it happens with most of the comp and high_res_comp images

  4. Mark Pitman3 years ago

    Hi, I have been trying to reproduce your issue and I am not seeing the same behavior. I am using a slightly different ajax call. Try this and see what status code you get back. If that doesn't provide much info, a Fiddler trace would be helpful for us.

    $.ajax(
      {
        type: 'GET',
        url: 'http://cache4.asset-cache.net/xc/465590745.jpg?v=1&c=IWSAsset&k=2&d=77BFBA49EF8789215ABF3343C02EA54863AD5F09AF132A9DF9580C9D64C26C7D0E83939DE7AA5169',
          success: function (data, status, xhr) {
          console.log(xhr.status);
          console.log(xhr.statusText);
        },
        error: function (xhr) {
            console.log(xhr.status);
            console.log(xhr.statusText);
            console.log(xhr.responseText);
        } 
      }
    );
    
  5. Sportority_api3 years ago

    after trying your code on few computers, i got this insight: * it works well on windows * it fails on mac (any browser)

    can you please try to reproduce this on mac?

    Thanks

  6. Mark Pitman3 years ago

    I tried this in Chrome and Firefox on OS X and it is working properly. Can you give more details on what behavior you are seeing?

  7. Sportority_api3 years ago

    This is about everything i can tell you about this error:

    • It happens for image urls for comp and high_res_comp, received from search query with api v3 as described in the first post of this thread.
    • It doesn't happen with urls received from search api v2
    • It happens if and only if the first request to an image from the browser is an ajax request
    • if we will try to get the image by navigating to it's url in the browser, it will be loaded just fine, and all the next ajax requests to this image will be ok.
    • for example, if we run the ajax code you posted http://jsfiddle.net/gr3wtnxd/1/, the response will be: 403 - Forbidden: Access is denied
    • request details:
    • Remote Address:212.199.202.9:80
    • Request URL:http://cache4.asset-cache.net/xc/465590745.jpg?v=1&c=IWSAsset&k=2&d=77BFBA49EF8789215ABF3343C02EA54863AD5F09AF132A9DF9580C9D64C26C7D0E83939DE7AA5169
    • Request Method:GET
    • Status Code:403 Forbidden
    • Request Headers
    • Accept:/
    • Accept-Encoding:gzip,deflate,sdch
    • Accept-Language:en-US,en;q=0.8,he;q=0.6
    • Cache-Control:max-age=0
    • Connection:keep-alive
    • Host:cache4.asset-cache.net
    • Origin:http://fiddle.jshell.net
    • Referer:http://fiddle.jshell.net/_display/
    • User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
    • Query String Parameters
    • v:1
    • c:IWSAsset
    • k:2
    • d:77BFBA49EF8789215ABF3343C02EA54863AD5F09AF132A9DF9580C9D64C26C7D0E83939DE7AA5169
    • Response Headers
    • Access-Control-Allow-Origin:*
    • Cache-Control:private, max-age=604800
    • Connection:keep-alive
    • Content-Length:1233
    • Content-Type:text/html
    • Date:Mon, 15 Sep 2014 14:54:27 GMT
    • Server:Microsoft-IIS/7.5
    • X-AspNet-Version:2.0.50727
    • X-Powered-By:ASP.NET

    response body looks like here: http://jsfiddle.net/nfqrmwLt/

  8. Getty Images Matt2 years ago

    Hi... sorry for the delay on this. We have released a fix for this problem (the URLs were being blocked by our white list). Let us know if you are still having issues.

    Thanks,

    Matt

  9. Sportority_api2 years ago

    Problem solved, thanks!

  10. Babbel_connect2 months ago

    Hi, sorry for reviving an old thread but I'm having exactly the same problem exposed here. I don't have a windows machine to test but apart from that I get the same 403 when trying to get any of the images returned by querying this endpoint "https://api.gettyimages.com/v3/search/images/creative".

    Here a sample of my request:

    1.   appendApiKeyHeader(xhr) {
    2.       xhr.setRequestHeader('Api-Key', 'xxxx...');
    3.       xhr.setRequestHeader('Authorization', 'Bearer  xxxxx....');
    4.     }
    5.  
    6.     stockSearch(query) {
    7.       const searchRequest = {
    8.         phrase: query,
    9.         exclude_nudity: true,
    10.         page_size: 10,
    11.         embed_content_only: true
    12.       };
    13.       $.ajax({
    14.         type: 'GET',
    15.         beforeSend: this.appendApiKeyHeader,
    16.         url: 'https://api.gettyimages.com/v3/search/images/creative',
    17.         data: searchRequest })
    18.         .success((data, textStatus, jqXHR) => this.updateStockResults(data))
    19.         .fail(function(data, err) { console.log('error: ', err)});
    20.     }
  11. Babbel_connect2 months ago

    ...To complement m previous post:

    that endpoint works well, but trying to get the images in its payload fails with 403 for a couple of times before actually succeeding.

    here a sample of a request

    1. Request URL:http://cache2.asset-cache.net/xc/502879567.jpg?v=2&c=IWSAsset&k=2&d=ZkZaVBdnLSiEHKB8DWljQW2MEbAP9UUDevJ31c66a8u0GUmyngYMXAAFGabi4Xr80
    2. Request Method:GET
    3. Status Code:403 Forbidden
    4. Remote Address:2.20.188.193:80

    Thanks for your help!

  12. Mark Pitman2 months ago

    I clicked on the URL you provided and the image displays in my browser. What happens when you try clicking it?

    http://cache2.asset-cache.net/xc/502879567.jpg?v=2&c=IWSAsset&k=2&d=ZkZaVBdnLSiEHKB8DWljQW2MEbAP9UUDevJ31c66a8u0GUmyngYMXAAFGabi4Xr80

  13. Babbel_connect2 months ago

    The problem is not opening the link in a new tab, trying to display the img inside a web is since the get request fails with "403 (Forbidden)"

    Here is a screenshot of a request, maybe that helps explaining.

  14. Getty Images Matt2 months ago

    This looks to be a problem on our side.

    Did this behavior just start recently?

  15. Babbel_connect2 months ago

    I'm actually jus starting to integrate the api. So there is no previous behaviour.

    I just find it very consistent with "Sportority_apis" problem that started this thread. http://jsfiddle.net/gr3wtnxd/1/

    1. It happens for image urls for comp and high_res_comp, received from search query with api v3 as described in the first post of this thread.
    2. It doesn't happen with urls received from search api v2
    3. It happens if and only if the first request to an image from the browser is an ajax request
    4. if we will try to get the image by navigating to it's url in the browser, it will be loaded just fine, and all the next ajax requests to this image will be ok.
    5. for example, if we run the ajax code you posted http://jsfiddle.net/gr3wtnxd/1/, the response will be: 403 - Forbidden: Access is denied

    I even get still the same result (403) following his fiddle -> http://jsfiddle.net/gr3wtnxd/1/ I tested it with a couple different uris, same result.

[ Page 1 of 1 ]