0

Delicious OAuth API Example Suggestion

For the API example for using OAuth with Delicious (http://delicious.com/help/oauthapi), I feel that part of it which is slightly misleading could be improved.

With step #5 (Building the "Base String") it explains how to sort the request parameters and concatenate them with ampersands in the format:

<param1>=<value1>&<param2=<value2>&...&<paramN>=<valueN>

and then how to put this request parameters string into the base string.

However, both steps state that values should be URL encoded:
1) When building the request parameters string, concatenating them with ampersands, it says "Note: each <value> must be url encoded."
2) When building the full base string, it says "Note: the <api url> and the <request parameters> must be url encoded."

This is misleading, because it suggests that the values for the parameters in the request parameters string (eg the value for oauth_consumer_key) should be URL encoded first, then concatenated with ampersands, and then this entire string be URL encoded again, which will result in an invalid signature (which left me stumped for a considerable amount of time).

Perhaps this could be cleared up in the example, perhaps suggesting that the full request parameters string is built up first, then the whole thing is URL encoded, or just by concatenating the parameters with %26 instead of &.

1 Reply
  • Hi,

    I think the Delicious OAuth API is clear in that it follows the
    spec and provides examples along the way.

    URL encoding the request parameters is just a simple way of
    saying parameter encoding in section 5.1 of the OAuth spec
    http://oauth.net/core/1.0a/#encoding_parameters

    Section 9.1.1 says another round of parameter encoding is needed:
    http://oauth.net/core/1.0a/#anchor13

    So it is indeed that URL encoding needs to be done twice.

    Thanks,
    Yu Wang
    Yahoo! Membership Team
    0
This forum is locked.

Recent Posts

in Y!OS Suggestions