We first do a Post to write a record to the database.
--e0d4eb72-04dc-461b-8611-e6cabade8507
Content-Type: application/http; msgtype=request
POST /UtBill/api/Codes/ServiceCode HTTP/1.1
Host: os-main-app.lkm.sungardps.lcl:8080
Content-Type: application/json; charset=utf-8
{
"ServiceType": 0,
"AllowDeposit": false,
"RefundEligible": false,
"RequireJurisdiction": false,
"RequireServiceClass": false,
"RequireInsideOutside": false,
"Code": "NewCode2",
"Description": "New Code 2",
"DirtyState": 1,
"Status": 1,
"UniqueId": "C-54f3a13cf0fc440aa335301c17224df5"
}
--e0d4eb72-04dc-461b-8611-e6cabade8507--
We then do a get with the same URL /UtBill/api/Codes/ServiceCode
What we receive back is a Json response listing all the records in the database, there is no provision to ask for a particular record.
What we do manually is search the response for the PSRID for the record we just added: We will get a response like this:
{"ServiceType":2,"AllowDeposit":false,"RefundEligible":false,"RequireJurisdiction":false,"RequireServiceClass":false,"RequireInsideOutside":false,"ProrationCodePSRid":null,"ProrationCode":null,"UDFormCodePSRid":null,"UDFormCode":null,"DeliveryPointUDFormCodePSRid":null,"DeliveryPointUDFormCode":null,"JurisdictionCodes":null,"ServiceClassCodes":null,"AssetClassCodes":null,"Code":"RRF","Description":"Renewable Resource Fund","PSRid":10,"LastChangeDateTimeUTC":"2013-08-02T08:08:22.323","LastChangeUser":"LKM\\richard.rugless","LastChangeJob":"LKM\\richard.rugless","CreationDateTimeUTC":"2013-08-02T08:08:22.323","CreationUser":"LKM\\richard.rugless","CreationJob":"LKM\\richard.rugless","Status":1,"DirtyState":0,"UniqueId":"S-aeaaaa98dfb34dba8f163fde0faec251"}]
I have emphasized the PSRid which in this response 10. Remember this is the last record in the last.
What we need to do then is to execute a PUT while changing some information to modify the record and the last piece we will do is to execute a delete for this record. In order to do that we have to append the PSRID to the end of the URL.
So /UtBill/api/Codes/ServiceCode/10
but since we don't know this PSRID before hand we would like to search the Response Body and parse this information along with a couple of other pieces of information so that we can automate this process. We have many databases and testing them all manually will take weeks!
Thanks for your help!
Bill