rtm.lists.getList - what are the parameters to input for the api_sig? Plus CORS issue

60 views
Skip to first unread message

Stuart Perry-Hughes

unread,
Sep 2, 2018, 3:32:51 PM9/2/18
to Remember The Milk API
Hi all,


Reading the docs on this and still unclear. I assume my request string will be as follows:

"https://www.rememberthemilk.com/services/rest/?method=rtm.lists.getList&api_key=${apiKey}&perms=read&api_sig=${apiSig}"

To generate an API sig I need to hash the following: 
"api_secret${apiSecret}permsread"

Where am I going wrong? Also my response from the server is:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

I'm using Axios for the HTTP requests, which can take a config object. I attempted the following:

{
headers: {
"Access-Control-Allow-Origin": "*"
}
}

This didn't work :(

Thanks in advance of your help!


Stuart

Jonathan Coleman

unread,
Sep 3, 2018, 5:28:22 PM9/3/18
to Remember The Milk API
You might consider using a library that's already built to handle this for you like https://github.com/michaelday/rtm-js.

Or inspecting the code there might give you a clue to what you're doing wrong.

Aaron Morris

unread,
Sep 12, 2018, 5:58:39 PM9/12/18
to remembert...@googlegroups.com
Hi Stuart,

I see a few things you might try changing:
  • The Get Lists method does not accept a 'perms' parameter.  Instead, it requires an 'auth_token' parameter.  It is while requesting the authentication token that you'll specify the permissions level.  RTM provides a reference page describing how to request the authentication token:  https://www.rememberthemilk.com/services/api/authentication.rtm
  • The API shared secret is not a parameter (per se), and so the value should be prefixed to the hash input without a label.  (example below)
  • You need to hash all parameters except for the API Signature parameter itself (obviously).  So for the Get List method, the minimum hash input includes the 'api_key', 'auth_token' and 'method' parameters.  If you're using any optional parameters--such as format or version--then those must be hashed too.

    For example:
    "{my_shared_secret}api_key{my_api_key}auth_token{my_auth_token}methodrtm.lists.getList"

    or with format and version:
    "{my_shared_secret}api_key{my_api_key}auth_token{my_auth_token}formatjsonmethodrtm.lists.getListv2"
Regarding your HTTP error...sorry I have no experience or insight there.

-Aaron M.

--

---
You received this message because you are subscribed to the Google Groups "Remember The Milk API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rememberthemilk...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages