API Details – Key Points

Validate the incoming Document:

   #Document.LoadFromString( #Context.Request.Content.FormVariables<'*POSTDATA'>.GetText )
   If (#Document.RootNode *Is *Null)
      <error handling>
     Return
   Endif

 

Instantiate and validate the incoming Document content as JSON:

      #RequestData <= #Document.RootNode *As #PRIM_JSON.Object
      If (#RequestData *Is *Null)
         <error handling>
         Return
      Endif

 

Retrieve the first and last name from the posted data:

      #xContactFirstName := #RequestData<'FirstName'>.AsString

      #xContactFirstName := #RequestData<'LastName'>.AsString