1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "credential": {
12 "@context": [
13 "https://www.w3.org/ns/credentials/v2",
14 "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json"
15 ],
16 "id": "urn:uuid:5b6d2c1e-0c1a-4a52-9a53-0c0f7a1c9e11",
17 "type": [
18 "VerifiableCredential",
19 "OpenBadgeCredential"
20 ],
21 "issuer": {
22 "id": "did:key:z6MkgAnvkP45uNxwCKeNdt6wrYkEjpYX4f7Nrd8MQqFL8Fbn",
23 "type": [
24 "Profile"
25 ],
26 "name": "Example University"
27 },
28 "validFrom": "2025-01-15T00:00:00Z",
29 "name": "Example Achievement",
30 "credentialSubject": {
31 "type": [
32 "AchievementSubject"
33 ],
34 "identifier": [
35 {
36 "type": "IdentityObject",
37 "hashed": false,
38 "identityHash": "learner@example.org",
39 "identityType": "emailAddress"
40 }
41 ],
42 "achievement": {
43 "id": "https://issuer.example/achievements/1",
44 "type": [
45 "Achievement"
46 ],
47 "name": "Example Achievement",
48 "description": "Awarded for completing the example course.",
49 "criteria": {
50 "narrative": "Complete all modules with a passing grade."
51 }
52 }
53 },
54 "proof": {
55 "type": "DataIntegrityProof",
56 "cryptosuite": "eddsa-jcs-2022",
57 "created": "2025-01-15T00:00:00Z",
58 "verificationMethod": "did:key:z6MkgAnvkP45uNxwCKeNdt6wrYkEjpYX4f7Nrd8MQqFL8Fbn#z6MkgAnvkP45uNxwCKeNdt6wrYkEjpYX4f7Nrd8MQqFL8Fbn",
59 "proofPurpose": "assertionMethod",
60 "proofValue": "z3iyvJ3hfobNHzMPsBC39QPoo57kX7UWTBkCjL7wda4hxWDoeDeb1tQPq7HueQbbAxBEofghDqXa1rG8MEJexaUWt"
61 }
62 },
63 "recipientIdentity": "learner@example.org"
64};
65
66
67const run = await client.actor("davidcondrey/wl-open-badges-verifier").call(input);
68
69
70console.log('Results from dataset');
71console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
72const { items } = await client.dataset(run.defaultDatasetId).listItems();
73items.forEach((item) => {
74 console.dir(item);
75});
76
77