Site Tools


guides:ws_submitterrequest

Web Service: submitterRequest

The submitterRequest web service is used to send a 'new' submitter request to CeRTNA.

As with other CeRTNA web services, you must use the login workflow to obtain a soft-token that can be used when calling the submitterRequest web service.

Click this link (Login Workflow Example) to review the Login workflow.

Your user credentials allow the backend web service to ensure that your user request is properly assigned to your organization.

This web service was updated in the CeRTNA January 2024 APEX update. It was expanded to support properties that indicate whether a MOU or COI or both will be submitted in support of this submitterRequest. Set the property values to true or false to indicate if an MOU or COI or both should be expected to follow via the postDocument request.

Additionally, in order to support follow-up resubmissions for requests that are in Failed or Rejected status, this web service now supports the ability for the end-user to provide a Request ID when calling the submitterRequest web service. If providing the Request ID for a resubmission (corrected issue) the current status must be in Failed or Rejected status for the request to be accepted.

Request Endpoint

Method URL
POST https://apex-prd.certna.org/APEX/Service/APEXPublicServer.svc/submitterRequest

Request Body

This endpoint accepts request parameters using an text/plain format. (They are part of the endpoint URL)

Request Headers

Key Value
Content-Type application/json
access_token {soft-token}

Request Parameters

Parm Name Req/Opt Format Description
RequestID Required [string] Use 0 when for the intial submitterRequest or use a Request ID when re-submitting a corrected submitterRequest. Including instances where an updated MOU or COI will be provided.
SubmitterTypeID Required [string] Must be on of the following numeric codes: 1 (Title Company) 2 (Lender) 8 (Government) 32 (Other)
PrimaryName Required [string] (Max Len: 255) This name must be unique by Submitter Name, City, State. Please provide name in uppercase. Be sure to escape this value for special characters.
Address1 Required [string] (Max Len: 100) Street address 1. Be sure to escape this value for special characters.
Address2 Required [string] (Max Len: 100) Street address 2. This can be an empty string. Be sure to escape this value for special characters.
City Required [string] (Max Len: 100) City name.
StateName Required [string] Two character state id.
PostalCode Required [string] Zip code. 5 or 9 character.
COIExpirationDate Required [string] If the SubmitterTypeID is 32 (Other) then a COI Expiration Date is required otherwise an empty string can be provided.
UpdateMOU Required [string] Indicates if a MOU will be uploaded with the postDocument call. (true or false.)
UpdateCOI Required [string] Indicates if a COI will be uploaded with the postDocument call. (true or false.)

JSON Response Parameters

Parm Name Format Description
result [string] If the submitterRequest is successfully created, the RequestID will be returned in the result property of the response. The RequestID is needed when sending along the associateed MOU and/or COI documents for the New Submitter Request.
code [string] Exception conditions will result in code/message being returned.
message [string] Longer description of exception condition.

As noted, any condition that results in an unsuccessful call to the submitterRequest web service will produce a JSON formatted response with a code and message property populated. Successful calls will result in the RequestID property being returned. The RequestID is a required parameter of the postDocument web service.

Sample Request

Endpoint: (With Parameters)

https://apex-prd.certna.org/APEX/Service/APEXPublicServer.svc/submitterRequest?RequestID=0&SubmitterTypeID=32&PrimaryName=EXAMPLE PRIMARY NAME&Address1=123 EXAMPLE ST.&Address2=&City=EXAMPLE CITY&StateName=CA&PostalCode=12345&COIExpirationDate=12/25/2024&UpdateMOU=true&UpdateCOI=true

Headers:

Content-Type: application/json (For the login process)

Content-Type: text/plain (For the web service call)

Body:

Body content is not required because the parameters are pass as text/plain content as part of the Endpoint URL.

Sample Response

Status Code: 200

{
    "result": "15"
}

OR

Status Code: 500 (When an error occurs.)

{
    "Exception": {
        "Code": "SubmitterRequestExists",
        "Message": "12|EXAMPLE PRIMARY NAME|EXAMPLE CITY, CA|EXAMPLE AGENT"
    }
}

Additional Comments

Comments and sample code are provided for reference purposes only and are not intended to show production quality code or all exception handling conditions and/or completed code blocks.

Comment 1:

The submitterRequest web service is the first step in a New Submitter Request workflow as documented in the following C# snippet.

It is important to note that when using the submitterRequest web service, the parameter value passed for docType must be either “MOU” or “COI”. This distinguishes the submitterRequest from the updateMOUCOIRequest web service call where the docType must be “MOURequest” or “COIRequest”.

These docType values help the server-side processes determine where to store the uploaded PDF document. CeRTNA keeps both the original request PDF documents as well as the approved PDF documents.

private void btnNewSubmitterRequest_Click(object sender, RoutedEventArgs e)
{
	// New Submtter Request Workflow:
	// Create New Submitter Request - Request ID is retured.
	// Send the MOU PDF document associated with the Request ID.
	// If Submitter Type is 'Other (32) send the COI PDF document associated with the Request ID.
 
	createNewSubmitterRequest(); // If successfull the tbRequestID.Text field will have the new Request ID.
 
	sendPDFFile("MOU");
 
	if (tbSubmitterTypeValue.Text == "32")
	{
		sendPDFFile("COI");
	}
}

Comment 2:

The following C# snippet shows how to login and call the submitterRequest web service. In this example, the parameters that are being supplied to the web service are copied from the fields on WPF form.

private void createNewSubmitterRequest()
{
            string strNewRequestID = "0";
 
            RestClient client = null;
            RestRequest request = null;
            IRestResponse response = null;
 
            string strURL = "https://" + getHost() + "/APEX/Service/APEXPublicServer.svc/user/login";
 
            // Password has to be hashed.
            // New convention uses a Salt value from the user record
 
            string strSalt = GetSalt(tbUserName.Text);
            string strPassword = tbPassword.Password.ToString();
 
            string strHashedPassword = HashPassword(strPassword, strSalt);
 
            string strParms = "{\n\t\"user_name\" : \"";
            strParms += tbUserName.Text;
            strParms += "\",\n\t\"password\" : \"";
            strParms += strHashedPassword;
            strParms += "\"\n}";
 
            client = new RestClient(strURL);
            request = new RestRequest(Method.POST);
 
            request.AddHeader("Cache-Control", "no-cache");
            request.AddHeader("Content-Type", "application/json");
 
            request.AddParameter("Login", strParms, ParameterType.RequestBody);
            response = client.Execute(request);
 
            if (response.IsSuccessful)  // Successfully logged in and a token has been provided
            {
                var jsonResult1 = JsonConvert.DeserializeObject<dynamic>(response.Content);
                string token = jsonResult1.access_token;
 
                strURL = null;
                client = null;
                request = null;
                response = null;
 
                // Note: Be sure to escape your PrimaryName, Address1, and Address2 values to avoid issues associated with invalid HTML characters appearing in the URL.
 
                strURL = "https://" + getHost() + "/APEX/Service/APEXPublicServer.svc/submitterRequest";
 
                if (tbRequestID.Text == "" || tbRequestID.Text == " " || tbRequestID.Text == "0")
                {
                    strURL = strURL + "?" + "RequestID=0";
                }
                else
                {
                    strURL = strURL + "?" + "RequestID=" + tbRequestID.Text;
                }
 
                strURL = strURL + "&" + "SubmitterTypeID=" + tbSubmitterTypeValue.Text;
                strURL = strURL + "&" + "PrimaryName=" + Uri.EscapeDataString(tbSubmitterName.Text);
                strURL = strURL + "&" + "Address1=" + Uri.EscapeDataString(tbAddress1.Text);
                strURL = strURL + "&" + "Address2=" + Uri.EscapeDataString(tbAddress2.Text);
                strURL = strURL + "&" + "City=" + tbCity.Text;
                strURL = strURL + "&" + "StateName=" + tbState.Text;
                strURL = strURL + "&" + "PostalCode=" + tbZipCode.Text;
                strURL = strURL + "&" + "COIExpirationDate="+tbCOIExpires.Text;
 
                // The following 2 properties have been added since the original release of the web service
                // If customers using the web service do not include these properties, their service call may not complete.
 
                if (tbSubmitterTypeValue.Text == "32")
                {
                    strURL = strURL + "&" + "UpdateMOU=true";
                    strURL = strURL + "&" + "UpdateCOI=true";
                }
                else
                {
                    strURL = strURL + "&" + "UpdateMOU=true";
                    strURL = strURL + "&" + "UpdateCOI=false";
                }
 
                client = new RestClient(strURL);
                request = new RestRequest(Method.POST);
 
                request.AddHeader("Cache-Control", "no-cache");
                request.AddHeader("access_token", token);
                request.AddHeader("content-type", "text/plain");
                //request.AddHeader("content-type", "application/x-www-form-urlencoded");
                response = client.Execute(request);
 
                if (response.IsSuccessful)
                {
                    var jsonResult2 = JsonConvert.DeserializeObject<dynamic>(response.Content);
 
                    strNewRequestID = jsonResult2.result;
                    tbRequestID.Text = strNewRequestID;
                }
            }
 
            return;
}

Comment 3:

A zip file with a VisualStudio 2019, C#, .NET/WPF project is available for download. The project uses NuGet packages RestSharp (Version 106.15.0) and Newtonsoft.Json (Version 13.0.1). This project will not build with RestSharp versions later than 106 due to changes in the library.

You do not have to build this project, the source code files can just be referenced for how to complete tasks associated with obtaining a soft-token so that the other web services can be called. The soft-token is a requirement on all the CeRTNA web services.

Comment 4:

As per the workflow snippet, CeRTNA expects that the required MOU and/or COI will be submitted as part of the workflow for creating a New Submitter Request. If the MOU and/or COI is not provide, the New Submitter Request will be rejected by CeRTNA staff.

Comment 5:

In preceding examples you will see references to objects like tbRequestID.Text or tbSubmitterTypeID.Text and names that start with 'tb'. These objects are field references on the WPF form that is part of the sample application uploaded to the Wiki. The sample application was written for the purposes of writing documentation as well as CeRTNA testing of our web services. The method that you use to supply the required properties for the web services will be dependent on your implementation. Pointing this out, simple to alleviate any confusion over where the 'tb' type variable references are coming from.

Below is a sample of the WPF form. The fields are filled based on the workflow being tested and the button being clicked.

guides/ws_submitterrequest.txt · Last modified: by brett.zamora