404 Client Error: Resource Not Found

Dokook Choe 21 Reputation points
2022-07-23T22:37:50.893+00:00

I am trying to use visual search api and I am using endpoint "https://api.bing.microsoft.com/v7.0/images/visualsearch" as suggested in the documentation but I am getting the 404 Client Error. https://learn.microsoft.com/en-us/answers/questions/915811/httperror-404-client-error-resource-not-found-for-1.html and https://learn.microsoft.com/en-us/answers/questions/168598/404-client-error-resource-not-found.html suggest that I am using the same endpoint.

Has the endpoint changed again?

Bing Visual Search
Bing Visual Search
A Bing service that gives you rich insights to help build compelling image applications on the device of your choice.
25 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 57,456 Reputation points
    2022-07-25T03:03:16.303+00:00

    Apologies @Dokook Choe I misread your request.

    Note: Make sure that you are using a POST and not a GET (GET is standard for browsers so that is why you might be seeing the 404 code in your browser as well)

    I tried out the visual search with postman and I am getting a 401 unauthorized error which means I believe the API is serving. You can try the following code with your API key and see if you get a successful response:

    curl -X POST -H "Ocp-Apim-Subscription-Key: **<yourkeygoeshere>**" -F knowledgeRequest="{\"imageInfo\":{\"url\":\"https://contoso.com/path/image.jpg\"}}" https://api.bing.microsoft.com/v7.0/images/visualsearch?mkt=en-us

    https://learn.microsoft.com/en-us/bing/search-apis/bing-visual-search/how-to/get-insights

    224186-image.png

    -----------------------------------

    If this is helpful please mark as correct answer.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Dillon Silzer 57,456 Reputation points
    2022-07-24T16:58:46.99+00:00

    Hi @Dokook Choe

    1) Yes, https://api.bing.microsoft.com/v7.0/images/visualsearch returns 404 error because it does not follow the standard for an endpoint call.

    2) If you are authenticated and have a subscription to the API, your link should be https://api.bing.microsoft.com/v7.0/images/search?q=mt+rainier

    You can use cURL to test it out (with your API key):

    curl -H "Ocp-Apim-Subscription-Key: <yourkeygoeshere>" https://api.bing.microsoft.com/v7.0/images/search?q=mt+rainier  
    

    Search the web for images

    https://learn.microsoft.com/en-us/bing/search-apis/bing-image-search/how-to/get-images


    If this is helpful please mark as correct answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.