REST service that provides an interface to update the PEEmailDetail table
Type | Description |
---|---|
System.String | the employee ID |
System.String | the email code |
System.String | the address code |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms){
string ID = "00000001", emailCd = "01", addrCd = "01";
string uri = $"https://fusion.superion.com/FusionOSServices/v2/ONESolution/PersonEntity/PEEmailDetail/{ID}/{emailCd}/{addrCd}";
string data =
@"[{
""peId"": ""00000001"",
""emailTypeCd"": ""01"",
""addrCd"": ""01"",
""emailAddr"": ""nayana1@sungard.com"",
""createWho"": ""NAYANA.THI~2"",
""createWhen"": ""4/15/2012 10:28:49 PM"",
""updateWho"": ""NAYANA.THI~2"",
""updateWhen"": ""4/15/2012 10:28:49 PM"",
""uniqueKey"": ""AD73344B-65DA-4FD8-815D-6DE512CAAC40""
}]";
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);
JObject response;
if (!string.IsNullOrWhiteSpace(result))
response = JObject.Parse(result);
}
}
The first logical directory after /PEAssocDetail is the PE ID. After that, the next directory is the email code, followed by the address code. All must be specified, and if a corresponding record exists, that record will be updated with the data in the request body. The body must contain the same ID, email code, and address code as the path. The JSON body can be copied from a GET and altered as needed. Errors are returned as JSON objects with messages in the #text attribute, e.g.: { "#text": "Cannot find Record to update" }