Title: Undefined constant, api Issues
Last modified: January 6, 2023

---

# Undefined constant, api Issues

 *  [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * (@kdowns)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/undefined-constant-api-issues/)
 * There is an undefined constant on /includes/class-handlers.php:68. This causes
   a server 500 error when attempting to hit the admin-ajax.php endpoint with the?
   action=narrative&type=info params. Similarly, if the api key is not yet defined
   in the plugin, the server returns a 422 http response which is an odd thing to
   validate with from the narrative app.
   There are also 2 functions that have (almost)
   duplicate functionality in /includes/class-request.php that parse the API request
   from the narrative app twice and return duplicate responses. These issues mean
   that the narrative app is not ever able to authenticate the plugin’s existence
   on the server properly as a 422 or 500 response is not a proper way to validate.
   Likewise, if the narrative app is improperly managing those responses, clients
   are not able to take appropriate action for troubleshooting the connection.TLDR:
   The narrative app is not ever able to validate the existence of plugin or validate
   the connection properly based on how the plugin responds to the API requests.
   Also a 500 error caused by an undefined constant should probably be addressed.

The topic ‘Undefined constant, api Issues’ is closed to new replies.

 * ![](https://ps.w.org/narrative-so/assets/icon-256x256.png?rev=2061930)
 * [Narrative Publisher](https://wordpress.org/plugins/narrative-so/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/narrative-so/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/narrative-so/)
 * [Active Topics](https://wordpress.org/support/plugin/narrative-so/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/narrative-so/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/narrative-so/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Kylen Downs](https://wordpress.org/support/users/kdowns/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/undefined-constant-api-issues/)
 * Status: not resolved