Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

making public/private not working ? #89

Closed
jcolomb opened this issue Feb 8, 2015 · 6 comments
Closed

making public/private not working ? #89

jcolomb opened this issue Feb 8, 2015 · 6 comments

Comments

@jcolomb
Copy link

jcolomb commented Feb 8, 2015

Here is the message I get:

fs_make_public(thisfigshareid)
Response [http://api.figshare.com/v1/my_data/articles/1301999/action/make_public]
  Date: 2015-02-08 12:56
  Status: 400
  Content-Type: application/json
  Size: 98 B

the article stays as "draft", it is a fileset.

@jcolomb
Copy link
Author

jcolomb commented Feb 9, 2015

I wonder if it is a figshare bug: the amount of space i am using has not changed: these articles are counted as public, probably...

@cboettig
Copy link
Collaborator

cboettig commented Feb 9, 2015

@jcolomb Thanks for the report and sorry for the slow reply.

The response is showing a status code 400 ("Bad Request"), even though the URL call still looks correct according to the current documentation.

Can you give me the header info from the response? (resp <- fs_make_public(id); resp$headers)

@jcolomb
Copy link
Author

jcolomb commented Feb 10, 2015

here you are:
$access-control-allow-credentials
[1] "True"

$access-control-allow-headers
[1] "X-Requested-With, X-File-Name, Content-Type, Accept"

$access-control-allow-methods
[1] "GET,PUT,POST,DELETE,OPTIONS"

$access-control-allow-origin
[1] "*"

$access-control-max-age
[1] "86400"

$content-type
[1] "application/json"

$date
[1] "Tue, 10 Feb 2015 18:48:40 GMT"

$server
[1] "nginx"

$transfer-encoding
[1] "chunked"

$connection
[1] "keep-alive"

attr(,"class")
[1] "insensitive" "list"

@cboettig
Copy link
Collaborator

Okay, my mistake, apparently make_public/make_private methods have always thrown 400 codes; As you can see @karthik actually tests that this is the case: https://github.com/ropensci/rfigshare/blob/master/tests/testthat/test_figshare.R#L187

I'll check in with figshare about that and see what I can learn.

@jcolomb
Copy link
Author

jcolomb commented Sep 28, 2015

HEY. found the problem!!!

you can make article public only if you first add a category to the article.
this works:

 fs_add_categories(thisfigshareid, "Neuroscience")
 fs_make_public(thisfigshareid)

maybe the make_public function should include a warning or add a default category if none is there.

@cboettig
Copy link
Collaborator

Thanks, yes, now I recall noticing that and never changed the default. PR welcome (or I'll get around to it eventually..)

@jcolomb jcolomb closed this as completed Nov 19, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants