Survey Monkey - 更新收集器的错误

问题描述:

突然之间,我们的代码停止工作,经过一些检查后,我们找到了哪里。Survey Monkey - 更新收集器的错误

Example using SM's config set for Postman

我们的代码是这样的:

internal async Task CreateNewCollector(string name) 
      { 
       _new_collector = await (
        await _client.PostAsyncAs<CollectorDetails>(
         _survey.Collectors(), 
         _client.MakeJsonContent(new { from_collector_id = _last_collector.id }) 
        ).ContinueWith(n => 
          _client.PatchAsyncAs<CollectorDetails>(
           new Uri(n.Result.href), 
           _client.MakeJsonContent(new { name = name, status = "open" }) 
          ) 
        ) 
       ); 
      } 

它创建了一个收集器和右它试图修补它改变其名称和状态之后。那是它失败的时候。由于在图像上所提到的,这是结果:

{"error": {"docs": "https://developer.surveymonkey.com/api/v3/#error-codes", "message": "Invalid schema in the body provided.", "id": "1002", "name": "Bad Request", "http_status_code": 400}} 

我接触的调查猴支持和阿曼达(技术支持工程师)引导我通过这一点。我必须将现有代码更改为,而不是在创建收集器后立即更新收集器,而是先将消息添加到它,然后再更新。像魅力一样工作。