I'm working on the most basic Valence use just to prove it works -- using php to run a "whoami" query.

I authenticate fine, get the userId, userKey, and userSig back. I set these in the userContext object. The call to createAuthenticatedUri seems to work well -- all parameters are in the GET url I would expect to see.

I've also verified that the command path (/d2l/api/lp/1.0/users/whoami/) is valid, from another developer who is connecting to a a completely different server.

However, when I try to make the request, D2L tells me "404 Page not found".

I can make a call to /d2l/api/versions/ and that returns just fine.

Anyone have any suggestions?

Thanks in advance.

有帮助吗?

解决方案

Please note that your path /d2l/api/lp/1.0/users/whoami/ is not valid: the proper route for the whoami API call is /d2l/api/lp/{ver}/users/whoami without the trailing slash, and with the right version number filled in to target the API contract you want to target among those offered by the LMS -- in your case, that might be /d2l/api/lp/1.0/users/whoami, but it's also likely that you have more modern API contracts available on your LMS as well, which you can determine using the call to retrieve the LMS' version table.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top