REST service that provides an interface to update the PENameMaster table
Type | Description |
---|---|
System.String | the employee ID |
using System.Net;
using Newtonsoft.Json.Linq;
public void MethodName(parms){
string ID = "00000001";
string uri = $"https://fusion.superion.com/FusionOSServices/v2/ONESolution/PersonEntity/PENameMaster/{ID}";
string data =
@"[{
""peId"": ""00000"",
""name"": ""Royal, Paul Cognos"",
""nameU"": ""ROYAL, PAUL COGNOS"",
""nameS"": ""Sr."",
""suffix"": """",
""nickname"": ""avr"",
""saluteCd"": """",
""affilCd"": ""1042"",
""selCd1"": ""1098T"",
""selCd2"": """",
""idStatus"": ""AC"",
""url"": """",
""uniqueKey"": ""1ddeb258-6089-11db-a45e-00306e2c5246"",
""nameLast"": ""Royal"",
""nameFirst"": ""Paul"",
""nameMiddle"": ""Cognos"",
""securityCd"": """",
""entityExpireDt"": """",
""createWhen"": ""11/7/2008 10:48:21 AM"",
""createWho"": """",
""updateWhen"": ""10/5/2020 6:33:00 PM"",
""updateWho"": ""RESTAPI"",
""ssn"": ""012345678"",
""globalGuid"": """",
""dba"": """",
""dbaU"": """",
""dbaS"": ""0000"",
""dbaPayeeFlag"": """"
}]";
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 logical directory after /PENameMaster is the PE ID. If a corresponding record exists, that record will be updated with the data in the request body. The body must contain the same ID 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" }