Need Help with Broken 301 Redirects Using Zendesk Public APIs | Community
Skip to main content

Need Help with Broken 301 Redirects Using Zendesk Public APIs

  • July 29, 2024
  • 3 replies
  • 0 views

Hello everyone,

I'm Ajay, and I'm facing an issue with setting up 301 redirects using Zendesk's public APIs. Here’s what I have done so far:

I've set the redirects using the following cURL command:

 

curl --location 'https://spotdraft8511.zendesk.com/api/v2/guide/redirect_rules' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic *******************************' \ --header 'Cookie: __cfruid=***************************************' \ --data '{ "redirect_rule": { "redirect_from": "/test", "redirect_status": 301, "redirect_to": "https://starship.spotdraftteam.com/hc/en-us/articles/20189112202269-Glossary-of-Terms" } }'

The API response confirms that the redirects are set:

 

{ "records": [ { "id": "01J2ZXX210RNZNMR85AZX2NX4T", "brand_id": "18869586801565", "redirect_from": "/test", "redirect_status": "301", "redirect_to": "https://spotdraft8511.zendesk.com/hc/en-us/articles/20189112202269-Glossary-of-Terms", "created_at": "2024-07-17T08:45:50.000Z", "updated_at": "2024-07-17T08:45:50.000Z" }, { "id": "01J2ZXTRY6F4ST01XMNXX8XXSN", "brand_id": "18869586801565", "redirect_from": "/test/test", "redirect_status": "301", "redirect_to": "https://starship.spotdraftteam.com/hc/en-us/articles/20189112202269-Glossary-of-Terms", "created_at": "2024-07-17T08:44:35.000Z", "updated_at": "2024-07-17T08:44:35.000Z" } ], "meta": { "has_more": false, "after_cursor": "L3Rlc3QvdGVzdA==", "before_cursor": "L3Rlc3Q=" } }
 

Despite this confirmation, accessing starship.spotdraftteam.com/test leads to a 404 error. 
The redirects are clearly broken.
 

I'm enrolled in the EAP/Beta feature for Custom URL Redirects API. The setup process included filling out a form, which I did. Despite re-attempting the redirects, they still don't work.


Here is the most recent API call I made:

 

curl --location 'https://spotdraft8511.zendesk.com/api/v2/guide/redirect_rules' \ --header 'Content-Type: application/json' \ --header 'Authorization: Basic *******************************' \ --header 'Cookie: __cfruid=***************************************' \ --data '{ "redirect_rule": { "redirect_from": "/test2", "redirect_status": 301, "redirect_to": "https://starship.spotdraftteam.com//hc/en-us/articles/20189112202269-Glossary-of-Terms" } }'

Does anyone have insights or suggestions on why this might be happening and how I can resolve it? Any help would be greatly appreciated as this is critical for our go-live.
 

Thanks in advance!

Best,
Ajay

3 replies

Greg29
  • July 30, 2024

Hi Ajay! When you signed up for the EAP, you should have received some information on where you should send any bug reports. Would you be able to send this information there to ensure it is looked into as soon as possible?


  • Author
  • July 31, 2024

Hi Greg,

I haven't received any emails about this. Do you know how I can get them? I did fill out the EAP form.


Greg29
  • August 1, 2024
Hi Ajay,
 
Apologies for that, I've actually been looking around and I can't find that information either. I'm going to look into that further on my side to find an appropriate place for you to go in the future.
 
For now, I think a good point would be to remove the slug at the end of the redirect_to parameter, since I saw this point being made in the documentation. I don't know if that is the root of the issue, but give that a try and let me know if it works while I continue to investigate!