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 an Array:

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

 

Iterate through the Array. Each entry has a ContactId, a FirstName and a LastName:

    For Each(#object) In(#RequestArray)
       #xContactIdentification := #object<'ContactID'>.AsInt32
       #xContactFirstName := #object<'FirstName'>.AsString
       #xContactLastName := #object<'LastName'>.AsString
    Endfor