• Dear All,
    I’m having hard time figuring why I’m getting back this error after making a POST:

    {"code":"cant_update_item","message":"Cannot update item","data":{"status":500}}

    the data that I’m posting is this one:

    post = { 'allega_file' : { '_file' : [232] } }

    where ‘allega_file’ is an ACF that contains a repeater field ‘_file’ where the id of the file is attached.

    I thought was an Authorization error but, after producing one of those I saw that the feedback it’s completely different.
    I took the reference on how structuring the repeater JSON from this POST
    https://www.ads-software.com/support/topic/cant-update-acfs-using-json/

    do you guys know where I’m doing it wrong?
    I’m attaching here the simple script that I’m using to test the ACF.
    (https://i.imgur.com/i1b1Xdx.png)

    To authenticate I’m using this WordPress plugin
    https://it.www.ads-software.com/plugins/application-passwords/

    thankyou

    • This topic was modified 6 years, 5 months ago by entalpia.
    • This topic was modified 6 years, 5 months ago by entalpia.
    • This topic was modified 6 years, 5 months ago by entalpia.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author airesvsg

    (@airesvsg)

    Hi @entalpia,

    Your data structure isn’t right.

    You need to use the key fields, see below:
    { fields: { 'allega_file' : { '_file' : [232] } } }

    Thanks

    Thread Starter entalpia

    (@entalpia)

    Hi @airesvsg,

    thank you for your answer,

    I’ve tried using the data structure you have described before but it’s still behaving in the same way.

    { 'fields' : { 'allega_file' : { '_file' : [232] } } }

    Here attached you can find a screenshot of the ACF backend interface

    View post on imgur.com

    in the script, I’m doing the POST at https://www.mysite.com/wp-json/acf/v2/page/149 endpoint, it should be right

    thank you

    Thread Starter entalpia

    (@entalpia)

    Hi @airesvsg,

    I’ve tried to change the API to V3 but it’s doing the same,
    After posting this question on StackOverflow (https://goo.gl/gDXLYS) a user suggests me to check the error.log but unfortunately does not show issues related to this. The access.log it’s showing my attempt to access to the endpoint, showing a 500 error but the error.log is empty.

    can you please give me some hint about which could be the error?
    I’m using a third party plugin (https://goo.gl/gVp7Bu) to access the WP api, could be this the problem?

    best

    Hi @entalpia

    Did you manage to solve this?

    Struggling aswell.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Python script fails POSTing some data.’ is closed to new replies.