Code Monkey home page Code Monkey logo

Comments (5)

Jason-Gush avatar Jason-Gush commented on June 29, 2024

Seems to be the problem.

if not (url and relationship):

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.

rpaw053 avatar rpaw053 commented on June 29, 2024

@Jason-Gush I don't actually remember why i did that

if not (url and relationship):

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

url = CharField(max_length=200, null=True)

load from json doesn't have that condition

So just if condition in load from csv method needs to be deleted

if not (url and relationship):

from nz-orcid-hub.

rpaw053 avatar rpaw053 commented on June 29, 2024
  • I did a quick check, Relationship field is needed and should be self for personal identifier. otherwise ORCID will give 400 error.

image

  • Checked further for url i still get error from ORCID if i dont set url into request payload for external identifiers, it says Reference field must not be empty
    image
  • When i set both url and relationship the record is updated.
    image

I was about to make changes but this still doesnt work from ORCID side

from nz-orcid-hub.

rpaw053 avatar rpaw053 commented on June 29, 2024

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 my Bearer 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'

image

  • 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"
}

image

  • If you remove url we still getting 400 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"
}

image

from nz-orcid-hub.

Jason-Gush avatar Jason-Gush commented on June 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.