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?
Yes, I can see why that would be frustrating.
I'll see if we can do something about it.
Andrew
--
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
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.
Yes, stage was updated to 0.20:
http://trac.co2.dgen.net/wiki/ReleaseNotes
I'll look into the ProfileCategoryResource issue - more soon.
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.
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.
Just to confirm I have been testing with 81AD003E3D31 and it still
isn't working.
Andy.
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.
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?