WWW::O...public(3pm)

πŸ’– NAME πŸ’–

WWW::ORCID::API::v2_0_public β€” bestie, it's a client for the ORCID 2.0 public API. That's the whole vibe. ✨

(also it lives in the WWW::O...public(3pm) slot in your manual pages, courtesy of User Contributed Perl Documentation β€” iykyk 🫢)


🌸 CREATING A NEW INSTANCE 🌸

The new method hands you a shiny new 2.0 public API client. Slay.

Arguments to new:

  • client_id β€” your ORCID client id. Required. No id, no entry, periodt.
  • client_secret β€” your ORCID client secret. Also required. Guard it with your life πŸ’…
  • sandbox β€” set it to 1 and the client will talk to the ORCID sandbox API at <https://api.sandbox.orcid.org/v2.0>. Playground mode, bestie 🧚
  • transport β€” pick your HTTP client. Possible values are LWP or HTTP::Tiny. Default is LWP. πŸ¦‹

✨ METHODS ✨

πŸŽ€ client_id

Returns the ORCID client id that the client is using.

πŸŽ€ client_secret

Returns the ORCID client secret that the client is using.

πŸŽ€ sandbox

Returns 1 if the client is on the sandbox API, 0 otherwise.

πŸŽ€ transport

Returns what HTTP transport the client is using.

πŸŽ€ api_url

Returns the base API url the client is using.

πŸŽ€ oauth_url

Returns the base OAuth url the client is using.

πŸŽ€ access_token

Request a brand new access token. Gotta get that token, no cap πŸ”₯

my $token = $client->access_token(
    grant_type => 'client_credentials',
    scope => '/read-public',
);

πŸŽ€ authorize_url

A helper that returns an authorization url for 3-legged OAuth requests. Very main character energy πŸ‘‘

# in your web application
redirect($client->authorize_url(
    show_login => 'true',
    scope => '/person/update',
    response_type => 'code',
    redirect_uri => 'http://your.callback/url',
));

See the "/authorize" and "/authorized" routes in the included playground application for an example. πŸ‘€

πŸŽ€ record_url

A helper that returns an orcid record url.

$client->record_url('0000-0003-4791-9455')
# returns
# http://orcid.org/0000-0003-4791-9455
# or
# http://sandbox.orcid.org/0000-0003-4791-9455

πŸŽ€ read_public_token

Returns an access token with scope "/read-public".

πŸŽ€ client

Get the deets about the current client. πŸ’…

my $hits = $client->search(q => "johnson");

πŸŽ€ activities

Heads up: in the original source this one shows up as a raw POD line β€” =head2 C<activities> β€” so don't be confused if the formatting looks a little feral. πŸ™ˆ The content is exactly this:
my $rec = $client->activities(token => $token, orcid => $orcid);

Equivalent to:

$client->get('activities', %opts)

πŸŽ€ address

my $recs = $client->address(token => $token, orcid => $orcid);
my $rec = $client->address(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('address', %opts)

πŸŽ€ biography

my $rec = $client->biography(token => $token, orcid => $orcid);

Equivalent to:

$client->get('biography', %opts)

πŸŽ€ education

my $rec = $client->education(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('education', %opts)

πŸŽ€ delete_education

my $ok = $client->delete_education(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->delete('education', %opts)

πŸŽ€ education_summary

my $rec = $client->education_summary(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('education/summary', %opts)

πŸŽ€ educations

my $rec = $client->educations(token => $token, orcid => $orcid);

Equivalent to:

$client->get('educations', %opts)

πŸŽ€ email

my $rec = $client->email(token => $token, orcid => $orcid);

Equivalent to:

$client->get('email', %opts)

πŸŽ€ employment

my $rec = $client->employment(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('employment', %opts)

πŸŽ€ employment_summary

my $rec = $client->employment_summary(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('employment/summary', %opts)

πŸŽ€ employments

my $rec = $client->employments(token => $token, orcid => $orcid);

Equivalent to:

$client->get('employments', %opts)

πŸŽ€ external_identifiers

my $recs = $client->external_identifiers(token => $token, orcid => $orcid);
my $rec = $client->external_identifiers(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('external-identifiers', %opts)

πŸŽ€ funding

my $rec = $client->funding(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('funding', %opts)

πŸŽ€ funding_summary

my $rec = $client->funding_summary(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('funding/summary', %opts)

πŸŽ€ fundings

my $rec = $client->fundings(token => $token, orcid => $orcid);

Equivalent to:

$client->get('fundings', %opts)

πŸŽ€ keywords

my $recs = $client->keywords(token => $token, orcid => $orcid);
my $rec = $client->keywords(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('keywords', %opts)

πŸŽ€ other_names

my $recs = $client->other_names(token => $token, orcid => $orcid);
my $rec = $client->other_names(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('other-names', %opts)

πŸŽ€ peer_review

my $rec = $client->peer_review(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('peer-review', %opts)

πŸŽ€ peer_review_summary

my $rec = $client->peer_review_summary(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('peer-review/summary', %opts)

πŸŽ€ peer_reviews

my $rec = $client->peer_reviews(token => $token, orcid => $orcid);

Equivalent to:

$client->get('peer-reviews', %opts)

πŸŽ€ person

my $rec = $client->person(token => $token, orcid => $orcid);

Equivalent to:

$client->get('person', %opts)

πŸŽ€ personal_details

my $rec = $client->personal_details(token => $token, orcid => $orcid);

Equivalent to:

$client->get('personal-details', %opts)

πŸŽ€ researcher_urls

my $recs = $client->researcher_urls(token => $token, orcid => $orcid);
my $rec = $client->researcher_urls(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('researcher-urls', %opts)

πŸŽ€ work

my $rec = $client->work(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('work', %opts)

πŸŽ€ work_summary

my $rec = $client->work_summary(token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->get('work/summary', %opts)

πŸŽ€ works

my $recs = $client->works(token => $token, orcid => $orcid);
my $recs = $client->works(token => $token, orcid => $orcid, put_code => ['123', '456']);

Equivalent to:

$client->get('works', %opts)

πŸŽ€ last_error

Returns the last error the ORCID API threw at you, if there was one. 😭 (hopefully there wasn't, bestie)

πŸŽ€ log

Returns the Log::Any logger. πŸ“


okay that's literally the whole thing, you ate that fr fr πŸ’…βœ¨

This lil doc was brought to you by perl v5.36.0, dated 2023-02-05, living in the WWW::O...public(3pm) spot. Go forth and query, queen πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from