How to find out if confluence server REST API uses prototype or context in URI-s?
Asked by stonecoldcrazyx:

So I've tried to use basic REST call on my local server instance started version 6.4.3 from atlassian SDK with atlas-run-standalone command, and it works like a charm

```
curl u admin:admin "http://myVmName:1990/confluence/rest/api/content"? | python -mjson.tool
```

I get a JSON answer and it's all nice. Also works when I type URI in a browser.

Now, at work we also use confluence, one test instance and one prod let's call it. Test is on version 6.6.2 and prod on 6.4.3 (like the one I used in SDK). On both of them similar curl call doesn't work - says page not found. Instances are behind HTTPS so I call curl with -k and -L also (I don't know if there's any loadbalancers or something in front of them). When I'm logged in in browser I try the same thing and get same answer. Now, I've managed to find somewhere the older "prototype" api and I've managed to get

```
https://confluence.myCompany.domain/rest/prototype/1/content/57934140
```

where 57934140 is ID of an existing page and that works!!

So my question is? What is the difference, some configuration, settings, missing something? Once again, same confluence versions 6.4.3 - standalone one and SDK. In the docs it says that [API is applicable to Confluence server 5.5 and later.](https://developer.atlassian.com/server/confluence/confluence-server-rest-api/)

Is the problem related to "context" [mentioned here](https://docs.atlassian.com/ConfluenceServer/rest/6.8.0/)? How can I find out should I use it or not?


Answers:
author: Minh Tran
body: Hi [@stonecoldcrazyx](/t5/user/viewprofilepage/user-id/382125),

I don't know how your above curl works

```
curl u admin:admin "http://myVmName:1990/confluence/rest/api/content"? | python -mjson.tool
```

It seems not correct syntax

Can you share with if you are trying to retrieve a Confluence page via REST api?

comments: author: stonecoldcrazyx
body: Hi [@Minh Tran](/t5/user/viewprofilepage/user-id/732683), actually I figure it out by going to our IT and seeing how it was installed. The point is that context was left empty, so simply running without "confluence" in the URL did the trick.


author: Minh Tran
body: [@stonecoldcrazyx](/t5/user/viewprofilepage/user-id/382125) right, not all Confluence instances are set up with a context path

I am happy you figured out the problem.


author: stonecoldcrazyx
body: [@Minh Tran](/t5/user/viewprofilepage/user-id/732683) thanks. I would though still like to know how can I check what is this context path (if any) ? Is this possible? Aside from going to IT and asking them obviously :)


author: Minh Tran
body: [@stonecoldcrazyx](/t5/user/viewprofilepage/user-id/382125) an easy way is that you can access confluence url or not

If you can access it, check out the if there is any constant uri path after the domain when you go through different pages

if there is one, that is context path. Otherwise, there is no context path


author: stonecoldcrazyx
body: [@Minh Tran](/t5/user/viewprofilepage/user-id/732683)ah ok I see. So this means that either there is a context named "confluence" or there is no context at all? So for example context cannot be "someRadnomWord" ?


author: Minh Tran
body: You can use any name for the context. That is configured by the guy who installs Confluence. You can check it out here for more information

<https://confluence.atlassian.com/doc/configuring-the-server-base-url-148592.html>

(See changing the context path part)


author: stonecoldcrazyx
body: [@Minh Tran](/t5/user/viewprofilepage/user-id/732683)Thanks a lot! This answers my question!


Tags: atl-dev

developer