Skip to main content
Answer

REST API to Update Attributes

  • November 10, 2023
  • 3 replies
  • 483 views

Forum|alt.badge.img

I’m trying to update an attribute value on appointments in Postman but the value will not update.

Here is my PUT request:{{acuBaseUrl}}/Appointment?$filter=ServiceOrderType eq 'PM' and AppointmentNbr eq 'SV001280-1'&$expand=Attributes&$select=AppointmentNbr,Attributes/Attribute,Attributes/Value

Here is the body:

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "AttributeID": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

I’m not sure what else needs to be done.  I’ve also tried using the Attribute ID of INSPECTED but it still won’t update.  I’m using the Default/22.200.001 endpoint.

Best answer by jinin

Hi @vpoulson 

You should use Attribute instead of AttributeID.  Could you please change and check?

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "Attribute": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

As per the default endpoint, it should be Attribute.
 

 

3 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • November 10, 2023

Hi @vpoulson 

You should use Attribute instead of AttributeID.  Could you please change and check?

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "Attribute": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}

As per the default endpoint, it should be Attribute.
 

 


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • November 10, 2023

@vpoulson  as @jinin suggested use the correct endpoint.

A related discussion on the issue:

Attributes not updated in PUT Request(creation of record) | Community (acumatica.com)

Also, dont use $filter or other parameters in the PUT call

{{acuBaseUrl}}/Appointment?$filter=ServiceOrderType eq 'PM' and AppointmentNbr eq 'SV001280-1'&$expand=Attributes&$select=AppointmentNbr,Attributes/Attribute,Attributes/Value

 

Instead make call to base entity with key fields in the bosy:

URL: {{acuBaseUrl}}/Appointment

body:

{

    "ServiceOrderType": { "value": "PM" },

    "AppointmentNbr": { "value": "SV001280-1" },

    "Attributes": 

    [

        {

            "Attribute": {"value": "Is Inspection Complete?"},

            "Value": {"value": true}

        }

    ]

}


Forum|alt.badge.img
  • Author
  • Freshman II
  • November 10, 2023

@RohitRattan88 thank you so much.