Couldn't communicate with WordPress Rest API using endpointSolved

Hey Murky! <3 from Canada

Bluehost.com Hosting

Getting this error on the console. Worked find on my localhost but can't seem to get it working thru Bluehost.com

Couldn't communicate with WordPress Rest API using endpoint: https://rustalberta.com/wp-json

BlueHost says "its shared server and behind firewall", maybe that is part of the problem?

Not sure if they made any modifications on their end. Now i am seeing the following debug info.

Web request callback raised an exception (JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.)
at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in <2ae3f091decd4989b3c4d466e6eb5985>:0
7kb/s in, 53kb/s out
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x00043] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000d9] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00053] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <2ae3f091decd4989b3c4d466e6eb5985>:0
at Oxide.Plugins.WPBridge.<Init>m__C (System.Boolean err, System.String json) [0x0003f] in <5eb737a0b7af43999e7c931a1178823b>:0
at Oxide.Plugins.WPBridge+<WordPressSiteIsUp>c__AnonStorey1.<>m__0 (System.Int32 code, System.String json) [0x00000] in <5eb737a0b7af43999e7c931a1178823b>:0
at Oxide.Plugins.WPBridge+WebRequester+<Get>c__AnonStorey1.<>m__0 (System.Int32 responseCode, System.String responseString) [0x00000] in <5eb737a0b7af43999e7c931a1178823b>:0
at Oxide.Core.Libraries.WebRequests+WebRequest.<OnComplete>b__42_0 () [0x00034] in <9882f28dc2204b4dba514a9ad18f5042>:0

Hi pounderinc,

It seems like the WP rest API is either not enabled or something is interfering with it.

  1. Have you done anything with the permalinks settings in wordpress?
    Permalinks settings: https://rustalberta.com/wp-admin/options-permalink.php
    Make sure Plain is not selected
  2. Do you have any custom .htaccess file?


If you try the above and still cant get it to work then create an account for me in wordpress and reach out in a private message and can have a look.

When the url https://rustalberta.com/wp-json/ responds something like this:

/ 20211029055144
// https://rustalberta.com/wp-json/

{
  "name": "Rust Alberta",
  "description": "The #1 Alberta Rust Server",
  "url": "https://rustalberta.com",
  "home": "https://rustalberta.com",
  "gmt_offset": "0",
  "timezone_string": "",
  "namespaces": [
    "oembed/1.0",
    "wpbridge",
    "elementor/v1",
    "wp/v2",
    "wp-site-health/v1"
.......................

Everything should be working.

Thanks for the quick reply Murky. I am back to work for a few days but will try and play with your suggestions and see if i can get it figured out. No modifications on my part to .htaccess.

No worries, hope you'll get it working. Oh and i updated both the plugins earlier today, found a bug with the numbers but is resolved now so make sure you grab the latest copy of both. Cheers

Hey @Murky your advice worked.

1. Have you done anything with the permalinks settings in wordpress?
Permalinks settings: https://rustalberta.com/wp-admin/options-permalink.php

Make sure Plain is not selected << this was the issue. My Wordpress setting had Plain selected.

Thanks for your help and advice. I'm going to monitor it for a few days and see how she works.

Thanks again!

Cody

Glad you found out what was causing the issue. I hope the plugin has delivered in the week that has been.

Locked automatically