Title: WordPress API task in Background
Last modified: March 13, 2018

---

# WordPress API task in Background

 *  [mathishuettl](https://wordpress.org/support/users/mathishuettl/)
 * (@mathishuettl)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/wordpress-api-task-in-background/)
 * Hello,
 * I have a few API endpoints in my WordPress page. The problem is, that the response-
   time takes about (6 – 30 seconds – depends on what is to do).
 * When a client sends a request to my api he have to wait 6 – 30 seconds for a 
   response and that is the problem.
 * I red about background dispatch – how does this work with wordpress? The only
   thing the API does is insert, delete or update posts.
 * At the moment the API does the following:
    1. Validate data 2. Check if the client_id
   exists and the client_secret matches 3. Check if the post already exists -> if
   yes update -> if no create 4. Update / Create post 5. (optional) Upload images
   with media_sideload_image() 5/6. Update custom fields -> update_field()
    -  This topic was modified 8 years, 2 months ago by [mathishuettl](https://wordpress.org/support/users/mathishuettl/).

Viewing 1 replies (of 1 total)

 *  [manishghimire](https://wordpress.org/support/users/manishghimire/)
 * (@manishghimire)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/wordpress-api-task-in-background/#post-10086892)
 * Hi [@mathishuettl](https://wordpress.org/support/users/mathishuettl/),
 * I think you should look up this WordPress background processing class in GitHub
   
   link:- [https://github.com/A5hleyRich/wp-background-processing](https://github.com/A5hleyRich/wp-background-processing)

Viewing 1 replies (of 1 total)

The topic ‘WordPress API task in Background’ is closed to new replies.

## Tags

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

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [manishghimire](https://wordpress.org/support/users/manishghimire/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/wordpress-api-task-in-background/#post-10086892)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
