public async Task <IHttpActionResult> PostSubscribe() { // Get our WebHook Client InstagramWebHookClient client = Dependencies.Client; // Subscribe to a geo location, in this case within 5000 meters of Times Square in NY var sub = await client.SubscribeAsync(string.Empty, Url, 40.757626, -73.985794, 5000); return(Ok(sub)); }
/// <summary> /// Subscribes to a geographic area identified by a center latitude and longitude and a radius extending from the center. /// </summary> /// <param name="client">The current <see cref="InstagramWebHookClient"/> instance.</param> /// <param name="id">A (potentially empty) ID of a particular configuration for this WebHook. This makes it possible to /// support multiple WebHooks with individual configurations.</param> /// <param name="urlHelper">A <see cref="UrlHelper"/> for computing the callback URI.</param> /// <param name="latitude">The center latitude of the geo-area to subscribe to.</param> /// <param name="longitude">The center longitude of the geo-area to subscribe to.</param> /// <param name="radius">The radius of the geo-area in meters between 0 and 5000.</param> /// <returns>A <see cref="InstagramSubscription"/> instance.</returns> public static Task <InstagramSubscription> SubscribeAsync(this InstagramWebHookClient client, string id, UrlHelper urlHelper, double latitude, double longitude, int radius) { if (client == null) { throw new ArgumentNullException("client"); } if (urlHelper == null) { throw new ArgumentNullException("urlHelper"); } Uri callback = GetCallback(id, urlHelper); return(client.SubscribeAsync(id, callback, latitude, longitude, radius)); }