I am currently playing around with some things...According to this link, I need to construct a route that is open to the following format
webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag
so I defined the route like so
config.Routes.MapHttpRoute( name: "DefaultApi3", routeTemplate: "{version}/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}/{passesUpdatedSince}", defaults: new { controller = "SerialNumbers", action = "GET", passesUpdatedSince = RouteParameter.Optional } ); However, the following route fails for the url
How can I configure the route so that the above url can reach my controller?
My controller looks like
[HttpGet] public HttpResponseMessage Get(string passesUpdatedSince ="") { //do stuff } UPDATE
Thanks to the comments, I've made the following changes.
the route
config.Routes.MapHttpRoute( name: "DefaultApi3", routeTemplate: "v1/devices/{deviceLibraryIdentifier}/registrations/{passTypeIdentifier}", defaults: new { controller = "SerialNumbers", action = "GET" } ); My controller is as follows
public HttpResponseMessage Get(string deviceLibraryIdentifier, string passTypeIdentifier, string passesUpdatedSince = "") { //do stuff } According to the Apple docs, is it right to assume the following the webservice calls could look like
http://localhost:31472/v1/devices/23lk5235232oijlk/registrations/pass.com.mypass http://localhost:31472/v1/devices/23lk5235232oijlk/registrations/pass.com.mypass?passesUpdatedSince=159025
as these are returning 404.
These, however, do work. http://localhost:31472/v1/devices/23lk5235232oijlk/registrations/pass.com.mypass/?passesUpdatedSince=1415l http://localhost:31472/v1/devices/23lk5235232oijlk/registrations/pass.com.mypass/
So would there be a way to get it to work without the presence of the / near the end of the url?
It does look like the device is unable to recognize the route. I get the following message
Get serial #s task (for device 2523ff2fswtsfdh6544, pass type pass.com.mypass, last updated (null); with web service url https://weburl) encountered error: Unexpected response code 404
http://localhost/v1/devices/24358235235loji200/registrations/pass.com.mypass/12a512??) will go along for the ride; your route only needs to specify what will be passed along in url segments./and omitting thepassesUpdatedSincewould make it work on my end, but it's not the exact route Apple would send. Unless I'm misinterpreting the apple docs?