Share via

Bing Maps Optimized Multi-Itinerary API - errorMessage : Request is not completed

Evans C 20 Reputation points
2023-07-12T21:01:31.04+00:00

I have a web app which I'm using to submit the payload as shown below, using an HTTP async POST request:

{
	"agents": [
	   {
		"name":"Care Five",
		"shifts": [
		    {
			"startTime":"2023-07-09T07:00:00",
			"startAddress":"26 Galbraith Rd, Andover, SP11 6AZ",
			"endTime":"2023-07-09T13:00:00",
			"endAddress":"The Commercial Centre, Suite 205, Picket Piece, Andover, SP11 6AZ"
		    }
		 ],
		"capacity":[3]
	   },
	   {
		"name":"Carer 2",
		"shifts": [
		    {
			"startTime":"2023-07-09T07:00:00",
			"startAddress":"17 Sheraton Ave, Basingstoke, RG22 4TS",
			"endTime":"2023-07-09T12:30:00",
			"endAddress":"The Commercial Centre, Suite 205, Picket Piece, Andover, SP11 6AZ"
		    }
		],
		"capacity":[3]
	   }
	],
	"itineraryItems": [
	    {
		"name":"Ameli Service",
		"openingTime":"2023-07-09T07:00:00",
		"closingTime":"2023-07-09T09:00:00",
		"dwellTime":"00:30:00",
		"priority":1,
		"address":"14 Walworth Rd, Andover, SP11 6LU"
	    },
	    {
		"name":"April Spring",
		"openingTime":"2023-07-09T07:00:00",
		"closingTime":"2023-07-09T10:00:00",
		"dwellTime":"00:45:00",
		"priority":1,
		"address":"Walworth Rd, Andover, SP11 6LY"
	    },
	    {
		"name":"Boris Beckham",
		"openingTime":"2023-07-09T07:00:00",
		"closingTime":"2023-07-09T10:45:00",
		"dwellTime":"01:00:00",
		"priority":1,
		"address":"15 High St, ANdover, SP10 1LJ"
	    },
	    {
		"name":"Augustus Summer",
		"openingTime":"2023-07-09T08:00:00",
		"closingTime":"2023-07-09T10:00:00",
		"dwellTime":"01:00:00",
		"priority":1,
		"address":"Station Rd, Overton, RG25 3DU"
	    }
	]
} 

After the initial API response returns a status code of 200 OK, I then visit the provided callback URL using an HTTP GET request. The second API response is somewhat confusing me, as I'm getting a status code of 200 OK but there's a "Request is not completed" errorMessage like this:

{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http://dev.virtualearth.net/Branding/logo_powered_by.png","copyright":"Copyright © 2023 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":1,"resources":[{"__type":"RouteProxyAsyncResult:http://schemas.microsoft.com/search/local/ws/rest/v1","callbackInSeconds":1,"callbackUrl":"https://dev.virtualearth.net/REST/V1/Routes/OptimizeItineraryAsyncCallback?key={API_KEY}","errorMessage":"Request is not completed.","isAccepted":true,"isCompleted":false,"requestId":"d21ddc15-94f9-4008-95a8-b5dc658908fd"}]}],"statusCode":200,"statusDescription":"OK","traceId":"d8916f4300804c1cbb8aafb24128aae0|DU00002E69|0.0.0.0"}

I can revisit the callback URL several times, but I still get the same result of "Request is not completed". Where am I going wrong?

Azure Maps
Azure Maps

An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.

0 comments No comments

Answer accepted by question author

rbrundritt 21,711 Reputation points Volunteer Moderator
2023-07-13T04:02:53.7066667+00:00

That means that your request is still processing and the results aren't yet ready. You need to periodically call that URL to check when it is completed. Once completed, it will have a URL to use to download the results. Note that this API is a batch process and can take several minutes or longer depending on the complexity and length of routes.

In addition to this API, the truck routing and batch geocoding APIs work in a similar way.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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