Comments (5)
Seems to be the problem.
NZ-ORCID-Hub/orcid_hub/models.py
Line 4304 in a2e5af4
Only passes when both URL and relationship are present, despite both being optional.
@rpaw053 any recall what you were intending here? Seems like lines 4304-4308 should just be deleted.
from nz-orcid-hub.
@Jason-Gush I don't actually remember why i did that
NZ-ORCID-Hub/orcid_hub/models.py
Line 4304 in a2e5af4
Most likely my copy paste error in commit 15236ea
Since in our reference model both url and relationship are optional, we can safely delete the lines(4304-4308) as you suggested
NZ-ORCID-Hub/orcid_hub/models.py
Line 4092 in a2e5af4
load from json doesn't have that condition
NZ-ORCID-Hub/orcid_hub/models.py
Line 4369 in a2e5af4
So just if condition
in load from csv method needs to be deleted
NZ-ORCID-Hub/orcid_hub/models.py
Line 4304 in a2e5af4
from nz-orcid-hub.
- I did a quick check,
Relationship
field is needed and should beself
for personal identifier. otherwise ORCID will give 400 error.
- Checked further for
url
i still get error from ORCID if i dont seturl
into request payload for external identifiers, it saysReference field must not be empty
- When i set both
url
andrelationship
the record is updated.
I was about to make changes but this still doesnt work from ORCID side
from nz-orcid-hub.
You can test this here: https://api.sandbox.orcid.org/v2.0/#!/Development_Member_API_v3.0/createExternalIdentifierv3
- So if you set everything in request, the record is created
201
, i have removed myBearer
code in the below samples
curl -X POST --header 'Content-Type: application/vnd.orcid+json; qs=4' --header 'Accept: application/json' --header 'Authorization: Bearer <your code>' -d '{
"external-id-type": "eid",
"external-id-value": "5553asas5213800sa",
"external-id-url": {
"value": "https://www.scopus.com/authid/detail.uri?authorId=5aa55352ss31800"
},
"external-id-relationship": "self",
"display-index": 0
}' 'https://api.sandbox.orcid.org/v3.0/0000-0001-8228-7153/external-identifiers'
- If you remove relationship, we get
400
exception, which i guess is expected.
curl -X POST --header 'Content-Type: application/vnd.orcid+json; qs=4' --header 'Accept: application/json' --header 'Authorization: Bearer <your code>' -d '{
"external-id-type": "eid",
"external-id-value": "5553asas5213800sa",
"external-id-url": {
"value": "https://www.scopus.com/authid/detail.uri?authorId=5aa55352ss31800"
}
"display-index": 0
}' 'https://api.sandbox.orcid.org/v3.0/0000-0001-8228-7153/external-identifiers'
{
"response-code": 400,
"developer-message": "400 Bad Request: There is an issue with your data or the API endpoint. 405 Method Not Allowed: Endpoint and method mismatch. 415 Unsupported Media Type: data must be in XML or JSON format. Full validation error: Unexpected character ('\"' (code 34)): was expecting comma to separate Object entries\n at [Source: (org.apache.catalina.connector.CoyoteInputStream); line: 7, column: 4]",
"user-message": "ORCID could not process the data, because they were invalid.",
"error-code": 9001,
"more-info": "https://members.orcid.org/api/resources/troubleshooting"
}
- If you remove
url
we still getting400
exception:
curl -X POST --header 'Content-Type: application/vnd.orcid+json; qs=4' --header 'Accept: application/json' --header 'Authorization: Bearer <your code>' -d '{
"external-id-type": "eid",
"external-id-value": "5553asas5213800sa",
"external-id-relationship": "self",
"display-index": 0
}' 'https://api.sandbox.orcid.org/v3.0/0000-0001-8228-7153/external-identifiers'
{
"response-code": 400,
"developer-message": "400 Bad Request: Invalid incoming message. Full validation error: Reference field must not be empty",
"user-message": "Invalid incoming message.",
"error-code": 9020,
"more-info": "https://members.orcid.org/api/resources/troubleshooting"
}
from nz-orcid-hub.
Turns out url is the canonical required field (tho not specified in either xsd or swagger :()
https://github.com/ORCID/ORCID-Source/blob/master/orcid-api-web/tutorial/personal_identifiers.md
As a consequence, shouldn't be merged unless there's a surprise and ORCID changes the model.
from nz-orcid-hub.
Related Issues (20)
- Work contributors erroring at ORCID unless contributor-attributes is fully populated
- Other ID task requires a valid visibility to be present
- Peer review upload requires an external-id-relationship for subject which ORCID doesn't
- QoL improvements for new keywords webform
- Flask-OAuthlib error when running flask commands HOT 2
- flask-admin: need to break down into separate chunks the changes added to flask-admin
- User with two emails responding to invite should over-write email rather than be locked out HOT 7
- Research Resource Proposal End Date errors when empty HOT 2
- To improve rating we need to remove support for TLS 1.0/1.1 HOT 1
- Document getssl application for setting and renewing server certificates
- UnicodeDecodeError with orcid_proxy HOT 2
- Add filter to View/Export People screen
- Leaking email addresses to Google
- Enable assertion of funded-by relationships in V3 work items
- Enable assertion-origin values in source HOT 1
- Renable parameter passing in API credential requests. HOT 1
- Upgrade solution to work with Python 3.10 HOT 2
- User Story: Merge user accounts HOT 2
- How to action a PUT to the Hub's API via the API? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nz-orcid-hub.