Title: Python script fails POSTing some data.
Last modified: June 12, 2018

---

# Python script fails POSTing some data.

 *  [entalpia](https://wordpress.org/support/users/entalpia/)
 * (@entalpia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/)
 * 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://wordpress.org/support/topic/cant-update-acfs-using-json/](https://wordpress.org/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](https://i.imgur.com/i1b1Xdx.png))
 * To authenticate I’m using this WordPress plugin
    [https://it.wordpress.org/plugins/application-passwords/](https://it.wordpress.org/plugins/application-passwords/)
 * thankyou
    -  This topic was modified 7 years, 11 months ago by [entalpia](https://wordpress.org/support/users/entalpia/).
    -  This topic was modified 7 years, 11 months ago by [entalpia](https://wordpress.org/support/users/entalpia/).
    -  This topic was modified 7 years, 11 months ago by [entalpia](https://wordpress.org/support/users/entalpia/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [airesvsg](https://wordpress.org/support/users/airesvsg/)
 * (@airesvsg)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/#post-10390899)
 * Hi [@entalpia](https://wordpress.org/support/users/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](https://wordpress.org/support/users/entalpia/)
 * (@entalpia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/#post-10391100)
 * Hi [@airesvsg](https://wordpress.org/support/users/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](https://imgur.com/a/5raP7DB)
 * in the script, I’m doing the POST at [http://www.mysite.com/wp-json/acf/v2/page/149](http://www.mysite.com/wp-json/acf/v2/page/149)
   endpoint, it should be right
 * thank you
 *  Thread Starter [entalpia](https://wordpress.org/support/users/entalpia/)
 * (@entalpia)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/#post-10394391)
 * Hi [@airesvsg](https://wordpress.org/support/users/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](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](https://goo.gl/gVp7Bu)) to access
   the WP api, could be this the problem?
 * best
 *  [Awert88](https://wordpress.org/support/users/awert88/)
 * (@awert88)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/#post-10546348)
 * Hi [@entalpia](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/acf-to-rest-api_cc0001.svg)
 * [ACF to REST API](https://wordpress.org/plugins/acf-to-rest-api/)
 * [Support Threads](https://wordpress.org/support/plugin/acf-to-rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-to-rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-to-rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-to-rest-api/reviews/)

## Tags

 * [ACF](https://wordpress.org/support/topic-tag/acf/)
 * [api](https://wordpress.org/support/topic-tag/api/)
 * [json](https://wordpress.org/support/topic-tag/json/)
 * [python](https://wordpress.org/support/topic-tag/python/)

 * 4 replies
 * 3 participants
 * Last reply from: [Awert88](https://wordpress.org/support/users/awert88/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/python-script-fails-posting-some-data/#post-10546348)
 * Status: not resolved