WWW::O...I::v2_0(3pm)

✨ NAME ✨

WWW::ORCID::API::v2_0 β€” a client for the ORCID 2.0 member API πŸ’–

Like, it's the Perl module that talks to ORCID for you so you don't have to hand-roll HTTP calls and cry about it. Slay.


πŸŽ€ CREATING A NEW INSTANCE πŸŽ€

The new method returns a new 2.0 member API client. That's it, that's the whole thing β€” instantiate and go πŸ¦‹

Arguments to new:

πŸ’œ client_id

Your ORCID client id (required). No cap, you cannot skip this one.

πŸ’œ client_secret

Your ORCID client secret (required). Also not optional bestie.

πŸ’œ sandbox

If you set this to 1, the client will talk to the ORCID sandbox API at https://api.sandbox.orcid.org/v2.0 instead of the real one. Perfect for practicing your little experiments πŸ§ͺ

πŸ’œ transport

Specify the HTTP client to use. Possible values are LWP or HTTP::Tiny. The default is LWP.


πŸ”₯ METHODS πŸ”₯

client_id

Returns the ORCID client id used by the client.

client_secret

Returns the ORCID client secret used by the client.

sandbox

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

transport

Returns what HTTP transport the client is using.

api_url

Returns the base API url used by the client.

oauth_url

Returns the base OAuth url used by the client.

access_token

Request a new access token. Fresh token, who dis ✨

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

authorize_url

Helper that returns an authorization url for 3-legged OAuth requests. (Yes, 3-legged. Like a tripod. Iconic.)

# 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

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

Return an access token with scope /read-public.

read_limited_token

Return an access token with scope /read-limited.

client

Get details about the current client.

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

activities

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)

add_address

$client->add_address($data, token => $token, orcid => $orcid);

Equivalent to:

$client->add('address', $data, %opts)

update_address

$client->update_address($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->update('address', $data, %opts)

delete_address

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

Equivalent to:

$client->delete('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)

add_education

$client->add_education($data, token => $token, orcid => $orcid);

Equivalent to:

$client->add('education', $data, %opts)

update_education

$client->update_education($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->update('education', $data, %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)

add_employment

$client->add_employment($data, token => $token, orcid => $orcid);

Equivalent to:

$client->add('employment', $data, %opts)

update_employment

$client->update_employment($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->update('employment', $data, %opts)

delete_employment

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

Equivalent to:

$client->delete('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)

add_external_identifiers

$client->add_external_identifiers($data, token => $token, orcid => $orcid);

Equivalent to:

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

update_external_identifiers

$client->update_external_identifiers($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

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

delete_external_identifiers

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

Equivalent to:

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

funding

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

Equivalent to:

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

add_funding

$client->add_funding($data, token => $token, orcid => $orcid);

Equivalent to:

$client->add('funding', $data, %opts)

update_funding

$client->update_funding($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->update('funding', $data, %opts)

delete_funding

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

Equivalent to:

$client->delete('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)

group_id_record

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

Equivalent to:

$client->get('group-id-record', %opts)

add_group_id_record

$client->add_group_id_record($data, token => $token);

Equivalent to:

$client->add('group-id-record', $data, %opts)

update_group_id_record

$client->update_group_id_record($data, token => $token, put_code => '123');

Equivalent to:

$client->update('group-id-record', $data, %opts)

delete_group_id_record

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

Equivalent to:

$client->delete('group-id-record', %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)

add_keywords

$client->add_keywords($data, token => $token, orcid => $orcid);

Equivalent to:

$client->add('keywords', $data, %opts)

update_keywords

$client->update_keywords($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

$client->update('keywords', $data, %opts)

delete_keywords

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

Equivalent to:

$client->delete('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)

add_other_names

$client->add_other_names($data, token => $token, orcid => $orcid);

Equivalent to:

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

update_other_names

$client->update_other_names($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

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

delete_other_names

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

Equivalent to:

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

peer_review

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

Equivalent to:

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

add_peer_review

$client->add_peer_review($data, token => $token, orcid => $orcid);

Equivalent to:

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

update_peer_review

$client->update_peer_review($data, token => $token, orcid => $orcid, put_code => '123');

Equivalent to:

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

delete_peer_review

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

Equivalent to:

$client->delete('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');

...and that's the whole vibe, bestie β€” it's literally just:

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

πŸŽ€ add_researcher_urls πŸŽ€

$client->add_researcher_urls($data, token => $token, orcid => $orcid);

Which is the same thing as:

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

same energy, different wrapper, no cap πŸ’œ

🌈 update_researcher_urls 🌈

$client->update_researcher_urls($data, token => $token, orcid => $orcid, put_code => '123');

Which is doing exactly:

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

πŸ¦‹ delete_researcher_urls πŸ¦‹

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

Which equals:

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

⭐ work ⭐

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

Which is:

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

πŸ’– add_work πŸ’–

$client->add_work($data, token => $token, orcid => $orcid);

Which is:

$client->add('work', $data, %opts)

🌸 update_work 🌸

$client->update_work($data, token => $token, orcid => $orcid, put_code => '123');

Which is:

$client->update('work', $data, %opts)

πŸ“ delete_work πŸ“

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

Which is:

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

✨ work_summary ✨

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

Which is:

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

πŸ‘‘ works πŸ‘‘

plural era, we love to see it β€” you can grab them all, or just pick the ones you want:

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

Which is:

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

πŸ’… last_error πŸ’…

Returns the last error returned by the ORCID API, if any. So if something went sideways, this is where the receipts live, bestie 🧾

🧚 log 🧚

Returns the Log::Any logger. Go off, log everything, main character energy for your debugging ✨


and that's the whole page, fr fr 🫢 This little beauty comes from perl v5.36.0, dated 2023-02-05 β€” drink some water, read your error logs, and go slay πŸ’–πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from