public void CreateWebhookHandledProperly() { var client = new MockWebClient(); client.Responses.Add(@" {""href"":""https:\/\/api.surveymonkey.net\/v3\/webhooks\/3289918"",""event_type"":""response_completed"",""subscription_url"":""http:\/\/targetsite.com\/api\/"",""object_type"":""collector"",""object_ids"":[""49143218""],""id"":""3289918"",""name"":""New webhook""} "); var api = new SurveyMonkeyApi("TestApiKey", "TestOAuthToken", client); var webhook = new Webhook { EventType = WebhookEventType.ResponseCompleted, Name = "New webhook", SubscriptionUrl = "http://targetsite.com/api/", ObjectType = WebhookObjectType.Collector, ObjectIds = new List <long> { 49143218 } }; var result = api.CreateWebhook(webhook); Assert.AreEqual("New webhook", result.Name); Assert.AreEqual(3289918, result.Id); Assert.AreEqual("POST", client.Requests.First().Verb); StringAssert.DoesNotContain("\"id\"", client.Requests.First().Body); }