Skip to content

Commit

Permalink
minor change in get.datasets.project.ids
Browse files Browse the repository at this point in the history
  • Loading branch information
sameerpadhye committed Oct 1, 2024
1 parent afb2150 commit df31cd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions R/helper.POSTapi_download_w_json2df.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ post.api.res.fetch<-function (base.url,
)
)

if (httr::status_code(result) < 200 || httr::status_code(result)>=300)
{
stop(paste("Data could not be retrieved. Please check the get_by & identifiers. Please also re-confirm whether the API key has the necessary permissions to obtain the requested data."))
}
# if (httr::status_code(result) < 200 || httr::status_code(result)>=300)
# {
# stop(paste("Data could not be retrieved. Please check the get_by & identifiers. Please also re-confirm whether the API key has the necessary permissions to obtain the requested data."))
# }

return(result)

Expand Down
13 changes: 6 additions & 7 deletions R/helper.get.bin.project.dataset.pids.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ bin.dataset.project.pids<-function (get.data.input,
add_headers('accept' = 'application/json',
'api-key' = apikey))

if (httr::status_code(get.data) < 200 || httr::status_code(get.data)>=300)
{
stop(paste("Data could not be retrieved. Please check the get_by & identifiers. Please also re-confirm whether the API key has the necessary permissions to obtain any/all data (esp. datasets and projects)"))
}

## Obtain the token as Json strings
## Obtain the token as Json strings

suppressMessages(

Expand Down Expand Up @@ -64,6 +59,10 @@ bin.dataset.project.pids<-function (get.data.input,
add_headers('accept' = 'application/json',
'api-key' = apikey))

if (httr::status_code(get.data.pids) < 200 || httr::status_code(get.data.pids)>=300)
{
stop(paste("Data could not be retrieved. Please check the get_by & identifiers. Please also re-confirm whether the API key has the necessary permissions to obtain any/all data (esp. datasets and projects)"))
}

## Obtain the content as Json strings

Expand Down Expand Up @@ -105,7 +104,7 @@ get.bin.dataset.project.pids<-function(data.input,
if(nrow(data.input)<=99)
{

bin_dataset_project_ids = data.input
bin_dataset_project_ids = data.input[,1]

# get_data_bins is a function to obtain the processids using the BOLD GET API.

Expand Down

0 comments on commit df31cd3

Please sign in to comment.