Community
Showing results for 
Search instead for 
Do you mean 
Reply

404 error for GET URL

Accepted Solution Solved
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom
Accepted Solution

404 error for GET URL

What am I doing wrong?

 

calling the url:

http://localhost/act.web.api/Help - Works like a charm!

http://localhost/act.web.api/groups - Gives a 404

 

What is the correct GET url to get a list of all the Groups, also to get a list of all the Contacts? This is the RAW Header I am using:

 

Authorization: Basic Y2hyaXMgaHVmZm1hbjo=
Act-Database-Name: act2015demo

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

Accepted Solutions
Solution
Accepted by topic author vivek
‎09-25-2015 03:20 AM
Employee
Posts: 236
Country: USA

Re: 404 error for GET URL

Read very carefully:

 

Try: http://localhost/act.web.api/api/groups/ 

 

NOT:  http://localhost/act.web.api/groups/, which is what you posted you tried.  That will give you a 404.

 

Notice /api/ url fragement is missing from the url you are trying.

 

View solution in original post


All Replies
Employee
Posts: 236
Country: USA

Re: 404 error for GET URL

Hi Vivek,

 

You'll want to spend a little more time reading the documentation:  http://localhost/Act.Web.API 

 

You hit the /authorize route to trade credentials (using Basic scheme as you demonstrated below) for a bearer token, which you then use to hit API endpoints.  API endpoints (such as /groups) won't accept basic credentials.  The documentation has an interactive demo.

 

HTH,

--Xavier

 

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: 404 error for GET URL

Hi Xavier,

 

Thanks for replying, well this is peculiar initially that is what I was trying to do but was still getting 404s so I guessed I had misunderstood it and so went back to trying Basic.

 

So here is the Raw header:

 

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdnIiOiIobG9jYWwpIiwiZGIiOiJhY3QyMDE1ZGVtbyIsInVuIjoiY2hyaXMgaHVmZm1hbiIsImlkIjoiMDg2MjczYzAtMTJjZi00NDZlLTlhZmUtZjA5MTY0NjI4ZDRkIiwiaWF0IjoiMjAxNS0wOC0yMFQxODo0NDo1MS41NzA1NTAxWiJ9.6y0VzdAsXeooUV-ALmLGu71tR6-Hv6bB2Jc5kczZqbs

 

and the URL is the same: http://localhost/act.web.api/groups

 

Which still returns a 404. When I present the basic authorization to the /authorize that works and returns a happy 200 plus the bearer token.

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Employee
Posts: 236
Country: USA

Re: 404 error for GET URL

404 status code means not found, which is a good hint your url is incorrect.  You'll want to get intimetly familar with HTTP status codes.

 

Try: http://localhost/act.web.api/api/groups/ 

 

Again, the help doc has links and demos for it
http://localhost/act.web.api/help/api/GET-api-Groups

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: 404 error for GET URL

Thanks Xavier, I understand that a 404 means that my request is for an unavailable resource. My GET requests result in a 404 from Fiddler whether I terminate with a '/' or not. 

 

When I use the in-Help Test-API it returns a 401. Ok so I thought maybe i created the bearer token incorrectly or copied it incorrectly, however the Test-API also returns a 401 for the URLs:

 

api/Help

api/Authorize + Header

 

However I get a well formed 200 reply from Fiddler for api/help as well as api/authorize + Header

 

Is there a configurational setting in IIS that the installer may have overlooked such as enabling .NET 4.5 etc as earlier? I'm sorry to be a burden, but I really do not want to waste time making zero progress and quitting on this.

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Solution
Accepted by topic author vivek
‎09-25-2015 03:20 AM
Employee
Posts: 236
Country: USA

Re: 404 error for GET URL

Read very carefully:

 

Try: http://localhost/act.web.api/api/groups/ 

 

NOT:  http://localhost/act.web.api/groups/, which is what you posted you tried.  That will give you a 404.

 

Notice /api/ url fragement is missing from the url you are trying.

 

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: 404 error for GET URL

Bingo! Thanks for your patience.

 

Yeah as you said, I was skim-reading and not paying enough attention.

 

I know it shouldn't be, but for an entrenched WinForms guy, this is all quite tough getting into. Give me a few months and I'll up to speed.

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog