Title: Broken API &#8211; HTTP 302 code
Last modified: November 21, 2024

---

# Broken API – HTTP 302 code

 *  Resolved [kalan79](https://wordpress.org/support/users/kalan79/)
 * (@kalan79)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/broken-api-http-302-code/)
 * I am trying to update an old website with Learnpress to reactive interesting 
   training materials. The website was developed by someone who left our company
   and I’m facing issue to make it work.
 * I have 2 different problems but probably with the same cause:
    - When a user wants to enroll to a course A, the enroll button does not seem
      to work as it brings back the user to the list of available courses. ==> I
      see an API Call “/wp-json/lp/v1/courses/enroll-course?_locale=user” by POST
      method that gets an HTTP 302 code
    - When the same user wants to enroll to a course B, the button to start does
      not even appear as if it was not possible to check the status of the user 
      for this course (can enroll, already enrolled, etc.) => API CALL in POST method“/
      wp-json/lp/v1/lazy-load/course-progress?_locale=user” gets an HTTP 302 code
 * In both cases the API does not seem to provide the expected answer but I can’t
   figure out the problem. I sometimes get an error message telling the JSON Response
   is not valid.
 * Any help would be appreciated.
 * s

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

 *  Plugin Support [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * (@briantp)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/broken-api-http-302-code/#post-18153122)
 * **Hi kalan79,**
 * Thank you for providing detailed information about the issue.
 * The HTTP 302 code usually indicates a redirection, which might be caused by a
   third-party plugin or server configuration. To troubleshoot:
    1. **Disable all plugins except LearnPress**
       Please disable all other plugins temporarily,
       leaving only LearnPress active, and check if the issue persists. This will help
       identify if another plugin is causing the redirection.
    2. **Check server redirection rules**
       If the problem continues, it might be due
       to server-level redirection rules in your `.htaccess` file (for Apache servers)
       or equivalent configuration for NGINX. Review these rules or consult with your
       hosting provider for assistance.
    3. **Clear cache**
       Clear any caching (browser, server, or plugin-based) and check
       again.
 * Once you’ve tested these steps, let us know the outcome, and we’ll assist further
   if needed.
 * Best regards,
   Brianvu-tp
 *  Thread Starter [kalan79](https://wordpress.org/support/users/kalan79/)
 * (@kalan79)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/broken-api-http-302-code/#post-18155305)
 * Thanks for your help, I managed to find the problem using some code to debug 
   log the redirection.
 * In the stack trace, there was an homemade plugin which was intercepting the API
   call and redirecting to the home page.
 * Thanks, this ticket can be closed.
 *  Plugin Support [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * (@briantp)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/broken-api-http-302-code/#post-18157830)
 * **Hi kalan79,**
 * We are glad to hear that you found the solution useful!
 * If you are satisfied with LearnPress, we would greatly appreciate it if you could
   leave us a 5-star review. A nice rating is a big motivation for us to keep up
   the hard work, and it’s really important to us.
 * Thank you very much for your feedback!
 * **Best regards,**
   Brianvu-tp

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

The topic ‘Broken API – HTTP 302 code’ is closed to new replies.

 * ![](https://ps.w.org/learnpress/assets/icon-256x256.gif?rev=3254420)
 * [LearnPress - WordPress LMS Plugin for Create and Sell Online Courses](https://wordpress.org/plugins/learnpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/learnpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/learnpress/)
 * [Active Topics](https://wordpress.org/support/plugin/learnpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/learnpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/learnpress/reviews/)

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [brianvu-tp](https://wordpress.org/support/users/briantp/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/broken-api-http-302-code/#post-18157830)
 * Status: resolved