Missing Profiles don't return 404 ?

1 view
Skip to first unread message

Andy Kent

unread,
Oct 16, 2007, 9:47:09 AM10/16/07
to Amee Developer
Just a quick note/question really,

I am working on interacting with AMEE via the xml api and I got a bit
frustrated because when I request a profile which doesn't exist the
server returns the whole collection of profiles rather than a 404
error as I would have expected.

Is there any particular reason for this?

Andrew Conway

unread,
Oct 16, 2007, 9:55:18 AM10/16/07
to amee-de...@googlegroups.com
Hi Andy

Yes, I can see why that would be frustrating.

I'll see if we can do something about it.

Andrew
--

Andy Kent

unread,
Oct 16, 2007, 10:04:29 AM10/16/07
to Amee Developer
Wow!

Thanks for the fast reply Andrew.
For now my solution is just to sniff the returned xml for a single
profile node but obviously this isn't ideal.

Keep me posted.

Andy

Andy Kent

unread,
Oct 16, 2007, 11:29:03 AM10/16/07
to Amee Developer
Has something just changed on the staging server?

I'm hitting a valid UID like this /profiles/5CABA95FAC8D and expecting
to get a ProfileCategoryResource back but instead I'm getting the
collection as a ProfilesResource.

This was working earlier I'm sure.

Regards,
Andy.

Andrew Conway

unread,
Oct 16, 2007, 3:11:36 PM10/16/07
to amee-de...@googlegroups.com
Hi Andy

Yes, stage was updated to 0.20:

http://trac.co2.dgen.net/wiki/ReleaseNotes

I'll look into the ProfileCategoryResource issue - more soon.

Andy Kent

unread,
Oct 17, 2007, 7:57:09 AM10/17/07
to Amee Developer
Hmm,

Thanks for the update Andrew, this is quite a big issue though as it
means we can't get past the first stage of the drill when going down
through the profiles side of the API.

Any ideas when this might be fixed or rolled back?


I have included some examples below which may or may not help
explain...


PATH: /profiles/000000000000 (not a valid profile, expect to get a 404
but actually get the whole collection)
ProfilesResource:
Pager:
RequestedPage: "1"
NextPage: "-1"
Start: "0"
From: "1"
Items: "1"
ItemsPerPage: "10"
LastPage: "1"
To: "1"
ItemsFound: "1"
PreviousPage: "-1"
CurrentPage: "1"
Profiles:
Profile:
Name:
modified: 2007-10-16 18:25:14.0
Permission:
Name: amee
modified: 2007-10-16 18:25:14.0
Username: clearleft
uid: C4B3E4894A17
Environment:
uid: 5F5887BCF726
created: 2007-10-16 18:25:14.0
uid: 81AD003E3D31
Environment:
uid: 5F5887BCF726
created: 2007-10-16 18:25:14.0


PATH: /profiles/6EB1A6A3808C (hit a valid profile, expect to get the
single profile and drill options back in the form of a
ProfileCategoryResource but instead get a ProfilesResource, very
strange)
ProfilesResource:
Pager:
RequestedPage: "1"
NextPage: "-1"
Start: "0"
From: "1"
Items: "1"
ItemsPerPage: "10"
LastPage: "1"
To: "1"
ItemsFound: "1"
PreviousPage: "-1"
CurrentPage: "1"
Profiles:
Profile:
Name:
modified: 2007-10-16 18:25:14.0
Permission:
Name: amee
modified: 2007-10-16 18:25:14.0
Username: clearleft
uid: C4B3E4894A17
Environment:
uid: 5F5887BCF726
created: 2007-10-16 18:25:14.0
uid: 81AD003E3D31
Environment:
uid: 5F5887BCF726
created: 2007-10-16 18:25:14.0

Hopfully that helps. (please note: in the examples above I only have
one item in my collection so they aren't too long)

Thanks for your assistance,
Andy.

Andrew Conway

unread,
Oct 17, 2007, 8:46:06 AM10/17/07
to amee-de...@googlegroups.com
Hi Andy

I've just checked and you don't have a profile with UID 6EB1A6A3808C
which is why it was returning a ProfilesResource. The ProfilesResource
in your email shows that there is only one profile there and its UID is
81AD003E3D31.

Andy Kent

unread,
Oct 17, 2007, 9:26:10 AM10/17/07
to Amee Developer
Yep, sorry for the confusion, I changed the UID because I wasnt sure
about the security issues of posting UID's to public mailing lists.

Just to confirm I have been testing with 81AD003E3D31 and it still
isn't working.

Andy.

Andy Kent

unread,
Oct 17, 2007, 9:44:48 AM10/17/07
to Amee Developer
Ok, so I'm going to be the big man and admit it.

I just discovered a typo in the URL i was requesting the profile from.

It appears to be fetching valid profiles fine now.

Still not getting 404 errors when it is invalid though which I think
could be fixed to make things a bit more intuitive.

Thanks for your help, really sorry for any confusion.

Andy.

Andrew Conway

unread,
Oct 17, 2007, 9:51:49 AM10/17/07
to amee-de...@googlegroups.com
Strange - here's the request I just sent:

GET /profiles/81AD003E3D31

and the xml response, which does contain a ProfileCategoryResource:

<?xml version="1.0"
encoding="UTF-8"?><Resources><ProfileCategoryResource><Path/><ProfileDate>200710</ProfileDate><Profile
created="2007-10-16 18:25:14.0" modified="2007-10-16 18:25:14.0"
uid="81AD003E3D31"><Path/><Name/><Environment
uid="5F5887BCF726"/><Permission created="2007-10-16 18:25:14.0"
modified="2007-10-16 18:25:14.0" uid="C4B3E4894A17"><Environment
uid="5F5887BCF726"/><Name>amee</Name><Username>clearleft</Username></Permission></Profile><DataCategory
uid="CD310BEBAC52"><Name>Root</Name><Path/></DataCategory><Children><ProfileCategories><DataCategory
uid="BBA3AC3E795E"><Name>Home</Name><Path>home</Path></DataCategory><DataCategory
uid="9E5362EAB0E7"><Name>Metadata</Name><Path>metadata</Path></DataCategory><DataCategory
uid="3BC3015876D3"><Name>Personal</Name><Path>personal</Path></DataCategory><DataCategory
uid="263FC0186834"><Name>Transport</Name><Path>transport</Path></DataCategory></ProfileCategories></Children></ProfileCategoryResource></Resources>

Is the xml you're getting different?

Reply all
Reply to author
Forward
0 new messages