Writing data with REST

Use the POST, PUT, or DELETE methods to access the API using REST.

POST Creates new data.

PUT Updates existing data.

DELETE Deletes existing data.

Creating a new person with REST

If you want to create a person in iMIS, construct a JSON object. In the following example code, we use the "$type" key word in the JSON object that represents our data contract. This is how we interface with SOA and tell SOA what type of object we are creating.

{
   "$type": "Asi.Soa.Membership.DataContracts.PersonData, Asi.Soa.Membership.Contracts",
   "PersonName": {
                "$type": "Asi.Soa.Membership.DataContracts.PersonNameData, Asi.Soa.Membership.Contracts",
                "FirstName": "George",
                "InformalName": "Milburn",
                "LastName": "Smith",
                "NamePrefix": "Mr."               
            },
}

Updating data with REST

In this example, we are modifying the informal name of a person. When you send the PUT method, you will have to include the party ID.

{
   "$type": "Asi.Soa.Membership.DataContracts.PersonData, Asi.Soa.Membership.Contracts",
   "PartyId": "00001",
   "PersonName": {
                "$type": "Asi.Soa.Membership.DataContracts.PersonNameData, Asi.Soa.Membership.Contracts",
                "FirstName": "George",
                "InformalName": "William",
                "LastName": "Smith",
                "NamePrefix": "Mr."               
            },
}


More