Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

POST Request for ACF plugin is not working

I am trying to publish a post in WP using rest api. I need some extra field too. So I have installed ACF plugin to insert extra field. After sending the request it returning 201 (post is created) but extra field value remaining empty(not updating).

                data = {
                    "title": (data['title']),
                    "content": (data['full_content']),
                    "author": 1,
                    "status": "draft",
                    "featured_media": get_image_id,
                    "acf" : {
                            "intro": "another try"
                    }
                    
                }
                response = requests.post(url, headers=headers, json=post_data)

Here intro is my custom field. In ACF plugin REST API option is True and in get request acf values showing empty value.So how can I insert extra field value?

like image 952
altu_faltu Avatar asked Oct 16 '25 06:10

altu_faltu


1 Answers

In your request above, try to use "fields", instead of "acf". See more in this comment.

like image 57
Paul Isaris Avatar answered Oct 18 '25 06:10

Paul Isaris