Closed ablaette closed 4 months ago
See #127 and specifically for record version deposition see #140
The Zenodo team has informed that the new API release is still not stable. Huge part of the migration has been done in #127 with a specific dev branch under work, but there are still missing parts.
Thanks a lot for your quick reply and my apologies that I failed to see #140. I understand the challenge you explain - so I will leave it with stating that I find your work incredibly useful. zen4R is a crucial building block for our RDM!!
Method has been migrated through #133
I wish to use the functionality to deposit a new version for a record using the method
$depositRecordVersion()
of theZenodoManager
class. The short explanation in the vignette is straight-forward and great. I greatly appreciate your systematic work to expose the abilities of the API. It has a great potential for our workflows, but here is a set of issues I encountered.This is initial sample code I used.
Resulting in:
[zen4R][INFO] ZenodoManager - Creating new version for record '7949074/versions/latest' (concept DOI: '10.5281/zenodo.3735140') -> POST /api/deposit/depositions/7949074/versions/latest/actions/newversion HTTP/1.1 -> Host: zenodo.org -> Accept-Encoding: deflate, gzip -> Cookie: 5569e5a730cade8ff2b54f1e815f3670=55bec0eaecfcbf5692fa89fa4aad17e3 -> Accept: application/json, text/xml, application/xml, / -> User-Agent: zen4R_0.9.9000 -> Content-Type: application/json -> Authorization:
-> Content-Length: 2
->
<- HTTP/1.1 404 NOT FOUND <- server: nginx <- date: Thu, 21 Dec 2023 07:27:14 GMT <- content-type: application/json <- transfer-encoding: chunked <- vary: Accept-Encoding <- access-control-allow-origin: <- access-control-expose-headers: Content-Type, ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset <- permissions-policy: interest-cohort=() <- x-frame-options: sameorigin <- x-xss-protection: 1; mode=block <- x-content-type-options: nosniff <- content-security-policy: default-src 'self' fonts.googleapis.com .gstatic.com data: 'unsafe-inline' 'unsafe-eval' blob: zenodo-broker.web.cern.ch zenodo-broker-qa.web.cern.ch maxcdn.bootstrapcdn.com cdnjs.cloudflare.com ajax.googleapis.com webanalytics.web.cern.ch <- strict-transport-security: max-age=31556926; includeSubDomains <- referrer-policy: strict-origin-when-cross-origin <- set-cookie: csrftoken=eyJhbGciOiJIUzUxMiIsImlhdCI6MTcwMzE0MzYzNCwiZXhwIjoxNzAzMjMwMDM0fQ.ImtPSTJuZTQ4RzV0a1k2SzgxdUpkdFdHUDVrdXlFcmFyIg.Dk2xBvMMQ_shaBiG1ObSjYpr1LyBZ1fkVgcfR-kQVDiJUBP72HPWOwswXpfOVmvgrQvtCCUGKg0fR4X7Q4pjXw; Expires=Thu, 28 Dec 2023 07:27:14 GMT; Max-Age=604800; Secure; Path=/; SameSite=Lax <- content-encoding: gzip <- [zen4R][ERROR] ZenodoManager - Error while creating new version: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
Based on the documentation, I explored the API with curl from the Terminal and I realized that the API does not accept " /api/deposit/depositions/7949074/versions/latest/actions". I can modify the API call as follows:
Running the code with the HACK on the link of the latest version ...
... now yields:
[zen4R][INFO] ZenodoManager - Creating new version for record '6546810' (concept DOI: '10.5281/zenodo.3822638') -> POST /api/deposit/depositions/6546810/actions/newversion HTTP/1.1 -> Host: zenodo.org -> Accept-Encoding: deflate, gzip -> Cookie: 5569e5a730cade8ff2b54f1e815f3670=55bec0eaecfcbf5692fa89fa4aad17e3; csrftoken=eyJhbGciOiJIUzUxMiIsImlhdCI6MTcwMzE0MzYzNCwiZXhwIjoxNzAzMjMwMDM0fQ.ImtPSTJuZTQ4RzV0a1k2SzgxdUpkdFdHUDVrdXlFcmFyIg.Dk2xBvMMQ_shaBiG1ObSjYpr1LyBZ1fkVgcfR-kQVDiJUBP72HPWOwswXpfOVmvgrQvtCCUGKg0fR4X7Q4pjXw -> Accept: application/json, text/xml, application/xml, / -> User-Agent: zen4R_0.9.9000 -> Content-Type: application/json -> Authorization:
-> Content-Length: 2
->
<- HTTP/1.1 201 CREATED <- server: nginx <- date: Thu, 21 Dec 2023 07:32:03 GMT <- content-type: application/json <- content-length: 3970 <- etag: "7" <- x-ratelimit-limit: 1000 <- x-ratelimit-remaining: 995 <- x-ratelimit-reset: 1703143983 <- retry-after: 59 <- permissions-policy: interest-cohort=() <- x-frame-options: sameorigin <- x-xss-protection: 1; mode=block <- x-content-type-options: nosniff <- content-security-policy: default-src 'self' fonts.googleapis.com .gstatic.com data: 'unsafe-inline' 'unsafe-eval' blob: zenodo-broker.web.cern.ch zenodo-broker-qa.web.cern.ch maxcdn.bootstrapcdn.com cdnjs.cloudflare.com ajax.googleapis.com webanalytics.web.cern.ch <- strict-transport-security: max-age=31556926; includeSubDomains <- referrer-policy: strict-origin-when-cross-origin <- access-control-allow-origin: <- access-control-expose-headers: Content-Type, ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset <- strict-transport-security: max-age=15768000 <- x-request-id: 06230b16baa2fc5b6b4429f5bdc4af0a <- [zen4R][INFO] ZenodoRequest - Fetching https://zenodo.org/api/user/records?q=recid:10417081&size=10&page=1&allversions=1 -> GET /api/user/records?q=recid:10417081&size=10&page=1&allversions=1 HTTP/1.1 -> Host: zenodo.org -> Accept-Encoding: deflate, gzip -> Cookie: 5569e5a730cade8ff2b54f1e815f3670=55bec0eaecfcbf5692fa89fa4aad17e3; csrftoken=eyJhbGciOiJIUzUxMiIsImlhdCI6MTcwMzE0MzYzNCwiZXhwIjoxNzAzMjMwMDM0fQ.ImtPSTJuZTQ4RzV0a1k2SzgxdUpkdFdHUDVrdXlFcmFyIg.Dk2xBvMMQ_shaBiG1ObSjYpr1LyBZ1fkVgcfR-kQVDiJUBP72HPWOwswXpfOVmvgrQvtCCUGKg0fR4X7Q4pjXw -> Accept: application/json, text/xml, application/xml, / -> User-Agent: zen4R_0.9.9000 -> Authorization:
->
<- HTTP/1.1 200 OK
<- server: nginx
<- date: Thu, 21 Dec 2023 07:32:03 GMT
<- content-type: application/json
<- transfer-encoding: chunked
<- vary: Accept-Encoding
<- x-ratelimit-limit: 1000
<- x-ratelimit-remaining: 994
<- x-ratelimit-reset: 1703143984
<- retry-after: 60
<- permissions-policy: interest-cohort=()
<- x-frame-options: sameorigin
<- x-xss-protection: 1; mode=block
<- x-content-type-options: nosniff
<- content-security-policy: default-src 'self' fonts.googleapis.com .gstatic.com data: 'unsafe-inline' 'unsafe-eval' blob: zenodo-broker.web.cern.ch zenodo-broker-qa.web.cern.ch maxcdn.bootstrapcdn.com cdnjs.cloudflare.com ajax.googleapis.com webanalytics.web.cern.ch
<- strict-transport-security: max-age=31556926; includeSubDomains
<- referrer-policy: strict-origin-when-cross-origin
<- access-control-allow-origin:
<- access-control-expose-headers: Content-Type, ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
<- strict-transport-security: max-age=15768000
<- x-request-id: 19359d63d4648134c8f1bb8cd53ca62c
<- content-encoding: gzip
<-
[zen4R][INFO] ZenodoManager - Successfully fetched list of depositions (user records)!
[zen4R][WARN] ZenodoManager - No record for id '10417081'!
[zen4R][INFO] ZenodoManager - Successful new version record created for concept DOI '10.5281/zenodo.3822638'
-> POST /api/records HTTP/1.1
-> Host: zenodo.org
-> Accept-Encoding: deflate, gzip
-> Cookie: 5569e5a730cade8ff2b54f1e815f3670=55bec0eaecfcbf5692fa89fa4aad17e3; csrftoken=eyJhbGciOiJIUzUxMiIsImlhdCI6MTcwMzE0MzYzNCwiZXhwIjoxNzAzMjMwMDM0fQ.ImtPSTJuZTQ4RzV0a1k2SzgxdUpkdFdHUDVrdXlFcmFyIg.Dk2xBvMMQ_shaBiG1ObSjYpr1LyBZ1fkVgcfR-kQVDiJUBP72HPWOwswXpfOVmvgrQvtCCUGKg0fR4X7Q4pjXw
-> Accept: application/json, text/xml, application/xml, /
-> User-Agent: zen4R_0.9.9000
-> Content-Type: application/json
-> Authorization:
-> Content-Length: 2313
->
<- HTTP/1.1 201 CREATED <- server: nginx <- date: Thu, 21 Dec 2023 07:32:03 GMT <- content-type: application/json <- content-length: 3000 <- etag: "4" <- x-ratelimit-limit: 1000 <- x-ratelimit-remaining: 993 <- x-ratelimit-reset: 1703143984 <- retry-after: 60 <- permissions-policy: interest-cohort=() <- x-frame-options: sameorigin <- x-xss-protection: 1; mode=block <- x-content-type-options: nosniff <- content-security-policy: default-src 'self' fonts.googleapis.com .gstatic.com data: 'unsafe-inline' 'unsafe-eval' blob: zenodo-broker.web.cern.ch zenodo-broker-qa.web.cern.ch maxcdn.bootstrapcdn.com cdnjs.cloudflare.com ajax.googleapis.com webanalytics.web.cern.ch <- strict-transport-security: max-age=31556926; includeSubDomains <- referrer-policy: strict-origin-when-cross-origin <- access-control-allow-origin: <- access-control-expose-headers: Content-Type, ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset <- strict-transport-security: max-age=15768000 <- x-request-id: b60d3bf03fe478f61fb79c4c27272137 <- [zen4R][INFO] ZenodoManager - Successful record deposition [zen4R][INFO] ZenodoManager - Deleting files copied from latest record
So zen4R is not conforming to the latest development of the API?
So I was able to overcome this issue, but then I realized that significant parts of the record metadata is lost with the new record, such as: Resource type, Creator, language, keywords, communities.
Finally, I can use
ZenodoManager$uploadFile()
for small files, but there is a rate limit for larger files that I cannot overcome for my 1-3 GB files.So I find the functionality of zen4R very, very useful, but I cannot use it as of now, unfortunately.