This service writes benefit assignment info to ONESolution.
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms){
string uri = "https://localhost:44398/v1/ONESolution/BenTek/Benefits/";
string data = "[" +
" {" +
" \"EntityId\": \"ROOT\", " +
" \"Id\" : \"E01010\", " +
" \"ActionCd\" : \"NEW\", " +
" \"BeneBeg\": 07/07/2017\" +
" \"BeneEnd\" : \"12/31/2050\", " +
" \"BenePlan\" : \"BNSWPTE0\", " +
" \"ApprvCd01\" : \"SEND\", " +
" } " +
" , " +
" { " +
" \"EntityId\": \"ROOT\", " +
" \"Id\" : \"E01011\", " +
" \"ActionCd\" : \"NEW\", " +
" \"BeneBeg\": 06/01/2017\" +
" \"BeneEnd\" : \"12/31/2050\", " +
" \"BenePlan\" : \"DENTPTE0\", " +
" \"ApprvCd01\" : \"WAIT\", " +
" } " +
" ]";
using (WebClient wc = new WebClient())
{
wc.Headers.Add("Content-Type", "application/json");
// Replace "ID" with supplied AppID
wc.Headers.Set("X-APPID", "ID");
// Replace "KEY" with supplied AppKey
wc.Headers.Set("X-APPKEY", "KEY");
string result = wc.UploadString(uri, "PUT", data);
var response = JObject.Parse(result);
var count = (string)response["RequestResponse"]["Count"];
// verify count is expected number
}
}
}
{
"RequestResponse": {
"Count": "2",
"DATA": null
}
}