GhostSharp icon indicating copy to clipboard operation
GhostSharp copied to clipboard

Support for subdirectories

Open MarcBroers opened this issue 5 years ago • 3 comments

My Ghost instance is located at https://mydomain.com/blog/cms. When I try to initialize using this URI, the wrapper won't function.

I'm guessing this is because the RestClient uses https://mydomain.com/ghost/api/v2/content/ as it's Url.

MarcBroers avatar Sep 08 '20 12:09 MarcBroers

The partial uri /ghost/api/v2/content/ is what gets added after wherever you're hosting Ghost, so have you tried using something like this?

var ghost = new GhostSharp.GhostContentAPI("https://mydomain.com/blog/cms/ghost/api/v2/content/", "a6d33f1b95ff17adf0f787a70a");

Or do you mean that instead of having to do a GET on "https://mydomain.com/ghost/api/v2/content/posts/some-random-post-id" (for example) you would actually do something like "https://mydomain.com/blog/cms/posts/some-random-post-id"?

grantwinney avatar Sep 21 '20 06:09 grantwinney

Sorry for the late response! But yes, we indeed have something in the lines of "https://mydomain.com/blog/cms/posts/some-random-post-id"

MarcBroers avatar Dec 01 '20 11:12 MarcBroers

No worries.. life gets crazy sometimes!

Do you know which part of your URL the /ghost/api/v3/content/ would get attached to then? Does it end up getting appended like this?

https://mydomain.com/blog/cms/ghost/api/v3/content/

In that case, you could probably just call the API like this:

var ghost = new GhostSharp.GhostContentAPI("https://mydomain.com/blog/cms/", "your_api_key");

If that's not the case, like if your API is available at https://mydomain.com/blog/cms/api/v3/content or simply https://mydomain.com/blog/cms , I'll need to make the library more flexible to account for that.

grantwinney avatar Dec 24 '20 17:12 grantwinney