oauth_problem=signature_invalid when POSTing a new folder

gonzofygonzofy Registered Users Posts: 2 Beginner grinner
I'm creating a script to migrate photo libraries from Fotki to SmugMug and am stuck when creating the folder structure programmatically on SmugMug.

Using OAuth, GET requests work fine. Also, POST requests to https://upload.smugmug.com/ work fine.

However, POST requests return 401 with the following error: oauth_problem=signature_invalid

Confusingly, I can make a GET request to https://api.smugmug.com/api/v2/node/md3GVt!children with no error, but a POST request to the same URL receives the 401 signature_invalid response.

I've tried setting the base URL to:
https://api.smugmug.com
https://api.smugmug.com/
https://api.smugmug.com/api/v2
https://api.smugmug.com/api/v2/
and continue to see the same problem.

Any suggestions on how to debug?

If it helps, I'm using Ruby, the Faraday Middleware gem, and the simple_oauth gem.

Thanks!

Comments

  • gonzofygonzofy Registered Users Posts: 2 Beginner grinner
    edited September 25, 2016
    Figured this out. I need to set Content-Type: application/json in the header.

    Feedback to SmugMug team: throwing an oauth error that suggests something is wrong with the signing of the path when there is simply a content-type error is pretty misleading.
  • gabbiegabbie Registered Users Posts: 66 Many Grins
    edited October 7, 2016
    Thanks for that feedback. I'm glad that you figured out your issue. I can definitely see how that can be confusing. The main issue in this case is that if we don't know that it's a json request we can't parse it correctly to determine whether it's an invalid one or one that's json encoded.
    gabbie
    SmugMug Product Manager
  • sujit1779sujit1779 Registered Users Posts: 46 Big grins
    edited October 15, 2016
    can you paste album creation code here
    Hi Gonzofy,

    Can you share code here, I am unable to create an album/ folder user API 2.0 . I am using .net

    Thanks.
    gonzofy wrote: »
    I'm creating a script to migrate photo libraries from Fotki to SmugMug and am stuck when creating the folder structure programmatically on SmugMug.

    Using OAuth, GET requests work fine. Also, POST requests to https://upload.smugmug.com/ work fine.

    However, POST requests return 401 with the following error: oauth_problem=signature_invalid

    Confusingly, I can make a GET request to https://api.smugmug.com/api/v2/node/md3GVt!children with no error, but a POST request to the same URL receives the 401 signature_invalid response.

    I've tried setting the base URL to:
    https://api.smugmug.com
    https://api.smugmug.com/
    https://api.smugmug.com/api/v2
    https://api.smugmug.com/api/v2/
    and continue to see the same problem.

    Any suggestions on how to debug?

    If it helps, I'm using Ruby, the Faraday Middleware gem, and the simple_oauth gem.

    Thanks!
Sign In or Register to comment.