Discussions
iMIS Cloud Rest API - Put Call
We are trying to make PUT call to BOs created by Panel in the cloud instance (20.3). It gives an 405 error.
GET for reading &
POST calls for inserting records are working.
So, need a scenario to Update a record.
Earlier POST calls were working even to UPDATE records, but I believe with recent REST changes(last week) in cloud , it has stopped working and POST endpoints are only for creating the records.
Here is the call we are trying to make.
var settings = {
"url": "/api/BCAPR_APPLICATION?ID=23155&Ordinal=1039",
"method": "PUT",
"async":false,
"headers": {
"Content-Type": "application/json",
"RequestVerificationToken": document.getElementById("__RequestVerificationToken").value
},
"data": JSON.stringify({"$type":"Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts","EntityTypeName":"CAPR_APPLICATION","PrimaryParentEntityTypeName":"Party","Identity":{"$type":"Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts","EntityTypeName":"CAPR_APPLICATION","IdentityElements":{"$type":"System.Collections.ObjectModel.Collection1[[System.String, mscorlib]], mscorlib","$values":["23155","1039"]}},"PrimaryParentIdentity":{"$type":"Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts","EntityTypeName":"Party","IdentityElements":{"$type":"System.Collections.ObjectModel.Collection
1[[System.String, mscorlib]], mscorlib","$values":["23155"]}},"Properties":{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts","$values":[{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"ID","Value":"23155"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"Ordinal","Value":{"$type":"System.Int32","$value":1039}},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"Institution_ID","Value":"23166"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_ALERT","Value":""},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_ASSESSMENT_TYPE","Value":"NP"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_ATTEMPT","Value":"z"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_CCPTP_DOC","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_COMPLETED_DATE","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_COUNTRY_OF_EDU","Value":"AT"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_CREATED_DATE","Value":"2020-04-16T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_CRITERIA_MET","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_DATE_DOC_RECD","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_DUE_DATE","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_EXAM_DATE","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_EXAM_LOCATION","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_EXAM_PROCESS_ID","Value":"ss"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_FEE","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_OPEN_DATE","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_OUTCOME","Value":"COMPLETE"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_PHASE","Value":"APP_IN"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_PROCESS_NAME","Value":"ALTEVAL"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_PROCESS_OWNER","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_PROCESS_TYPE","Value":"CRED"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_PROCESSING_WEEKS","Value":"a"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_RELATED_PROCESS","Value":"aa"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_REOPEN_DATE","Value":"0001-01-01T00:00:00"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_STATUS","Value":"REG"},{"$type":"Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts","Name":"APP_UNIV_CONF","Value":"a"}]}}),
};
jQuery.ajax(settings).done(function (response) {
console.log(response);
});
Thanks,
Akshay Paladiya