These docs are for v20.3.44. Click to read the latest docs for v20.3.186.

Discussions

Ask a Question
Back to All

Custom Table update via API

Hello,

We have 2 custom tables that we use to store various pieces of information about our Members. One is called 'Info' the other is 'Application'. The application table stores information about the Member Application Process.

I have been able to successfully update the 'Info' table without problem, but I simply cannot update the Application no matter what I try.

Doing a GET: /api/Application?PartyId=25 returns:

{
"$type": "Asi.Soa.Core.DataContracts.PagedResult1[[Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts]], Asi.Contracts", "Items": { "$type": "System.Collections.Generic.List1[[Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts]], mscorlib",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericEntityData, Asi.Contracts",
"EntityTypeName": "Application",
"PrimaryParentEntityTypeName": "Party",
"PrimaryParentIdentity": {
"$type": "Asi.Soa.Core.DataContracts.IdentityData, Asi.Contracts",
"EntityTypeName": "Party",
"IdentityElements": {
"$type": "System.Collections.ObjectModel.Collection`1[[System.String, mscorlib]], mscorlib",
"$values": [
"25"
]
}
},
"Properties": {
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyDataCollection, Asi.Contracts",
"$values": [
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "ACCEPTANCE",
"Value": {
"$type": "System.Boolean",
"$value": false
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPLICATION_RECEIVED"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPROVAL_SENT"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPROVAL1_RECEIVED"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPROVAL2_RECEIVED"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPROVED1",
"Value": {
"$type": "System.Boolean",
"$value": false
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "APPROVED2",
"Value": {
"$type": "System.Boolean",
"$value": false
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "BOARD_APPROVED"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "BOARD_SENT"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "PartyId",
"Value": "25"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "MEM_NUMBER1",
"Value": {
"$type": "System.Int32",
"$value": 0
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "MEM_NUMBER2",
"Value": {
"$type": "System.Int32",
"$value": 0
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "MEM_TYPE"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "PAY_METHOD"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUP_EMAILS",
"Value": {
"$type": "System.Boolean",
"$value": false
}
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUPPORTER1",
"Value": "9999"
},
{
"$type": "Asi.Soa.Core.DataContracts.GenericPropertyData, Asi.Contracts",
"Name": "SUPPORTER2",
"Value": "8888"
}
]
}
}
]
},
"Offset": 0,
"Limit": 100,
"Count": 1,
"TotalCount": 1,
"NextPageLink": null,
"HasNext": false,
"NextOffset": 0
}

I'm simply trying to update the 'SUPPORTER1' & 'SUPPORTER2' fields, but I cannot get the API to do so.

What I've tried:

POST: /api/Application?PartyId=25
This returns: An error occurred. Please contact the administrator.

PUT: /api/Application?PartyId=25
This returns:
{
"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "The requested resource does not support http method 'PUT'."
}

PATCH: /api/Application?PartyId=25
This returns:
{
"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "The requested resource does not support http method 'PATCH'."
}

Removing the partyId query string:

POST: /api/Application
This returns: An error occurred. Please contact the administrator.

PUT: /api/Application
{
"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "The requested resource does not support http method 'PUT'."
}

PATCH: /api/Application
{
"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "The requested resource does not support http method 'PATCH'."
}

Adding the PartyId as a URL segment:
POST: /api/Application/25
This Returns: An error occurred. Please contact the administrator.

PUT: /api/Application/25
This Returns: An error occurred. Please contact the administrator.

PATCH: /api/Application/25
{
"$type": "System.Web.Http.HttpError, System.Web.Http",
"Message": "The requested resource does not support http method 'PATCH'."
}

What is the correct way of doing this??