Title: API Result JS
Last modified: June 7, 2023

---

# API Result JS

 *  [mioTX](https://wordpress.org/support/users/miotx/)
 * (@miotx)
 * [3 years ago](https://wordpress.org/support/topic/api-result-js/)
 * I am using the “API XML/JSON Request” and receiving a response in json with a
   custom URL in the variable named postLoginPage from the response to then redirect
   a user to that URL?
 * The response received in the console is as follows:
   {“d”:{“id”:”43″,”type”:”customer.
   type.individual”,”name”:”TEST CUSTOMER”,”sessionId”:”0fdb411ad7ec5a64545″,”postLoginPage”:”**
   postLogin.html?vbklkIjoiMGZkYjQxMWFk&logout=aHR0cHM2U=**“}}
 * I need to extract the postLoginPag and then redirect the user to my base URL 
   + the postLoginPage, e.g. based on the response above it should redirect to “
   [https://testing.com/](https://testing.com/)**postLogin.html?vbklkIjoiMGZkYjQxMWFk&
   logout=aHR0cHM2U=**“
 * And my JS is as follows:
 * // Redirect the user to the constructed URL
   window.location.href = ‘response.
   d.postLoginPage’;
 * What am I doing wrong?

The topic ‘API Result JS’ is closed to new replies.

 * ![](https://ps.w.org/wpcf7-redirect/assets/icon-256x256.gif?rev=3416723)
 * [Redirection for Contact Form 7](https://wordpress.org/plugins/wpcf7-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcf7-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcf7-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcf7-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcf7-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcf7-redirect/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mioTX](https://wordpress.org/support/users/miotx/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/api-result-js/)
 * Status: not resolved