GithubHelp home page GithubHelp logo

Connect UI (reserve) to API about doi-ui HOT 2 CLOSED

nasa-pds avatar nasa-pds commented on August 22, 2024
Connect UI (reserve) to API

from doi-ui.

Comments (2)

eddiesarevalo avatar eddiesarevalo commented on August 22, 2024

@tloubrieu-jpl I am trying to to send up a doi reservation request as specified in the swagger hub API https://app.swaggerhub.com/apis/PDS_APIs/pds_doi_api/0.1#/dois/post_dois but I keep getting a 400 bad request error.

I tried testing by sending up the exact example that is shown in swaggerhub but it still throws a 400 bad request error. Can you please clarify as to what the parameters should look like?

I am sending this POST request payload:

{
  "labels": [
    {
      "status": "Reserved",
      "title": "Laboratory Shocked Feldspars Bundle",
      "publication_date": "2020-03-11",
      "product_type_specific": "PDS4 Collection",
      "author_last_name": "Johnson",
      "author_first_name": "J. R.",
      "related_resource": "urn:nasa:pds:lab_shocked_feldspars"
    }
  ]
}

To this URL:
http://localhost:8085/PDS_APIs/pds_doi_api/0.1/dois?action=reserve&[email protected]&node=eng
I am tunneled in and am sure since I can see the list at http://localhost:8085/PDS_APIs/pds_doi_api/0.1/dois

I am not sure if I am missing something here.

from doi-ui.

tloubrieu-jpl avatar tloubrieu-jpl commented on August 22, 2024

@eddiesarevalo I updated the server since the error message are clearer with the new version.

I tested the request as follow and it worked:
curl --location --request POST 'http://localhost:8085/PDS_APIs/pds_doi_api/0.1/dois?action=reserve&[email protected]&node=eng'
--header 'Content-Type: application/json'
--data-raw '{
"labels": [
{
"status": "Reserved",
"title": "Laboratory Shocked Feldspars Bundle collection",
"publication_date": "2020-03-11",
"product_type_specific": "PDS4 Collection",
"author_last_name": "Johnson",
"author_first_name": "J. R.",
"related_resource": "urn:nasa:pds:lab_shocked_feldspars"
}
]
}
'

Howver if you re-run it you should have error 400 because of duplication, but you'll have the error message in response.

You should use it to display the error to the user.

Thanks

from doi-ui.

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.