DataSrc:DemoJan25/StrapiEvents: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
|url = https://unitapedia.univ-unita.eu/strapi/api/events | |url = https://unitapedia.univ-unita.eu/strapi/api/events | ||
|format = JSON | |format = JSON | ||
|data = eventId = data.*.id, eventCreated = data.*.attributes.createdAt | |||
<!-- If "Public" role is enabled for events, you can remove this line --> | |||
|headers = Authorization: Bearer YOUR_TOKEN_HERE | |||
<!-- Pull fields from the JSON: | |||
- data.*.id | |||
- data.*.attributes.createdAt | |||
- data.*.attributes.updatedAt | |||
- data.*.attributes.publishedAt | |||
--> | |||
|data = eventId = data.*.id, | |||
eventCreated = data.*.attributes.createdAt, | |||
eventUpdated = data.*.attributes.updatedAt, | |||
eventPublished = data.*.attributes.publishedAt | |||
|debug = 1 | |debug = 1 | ||
}} | }} | ||
<!-- 2) Store each array element as a subobject --> | <!-- 2) Store each array element as a subobject via #store_external_table --> | ||
{{#store_external_table: StrapiEvents | {{#store_external_table: StrapiEvents | ||
| | |event_id = {{{eventId}}} | ||
| | |event_created = {{{eventCreated}}} | ||
|event_updated = {{{eventUpdated}}} | |||
|event_published = {{{eventPublished}}} | |||
}} | }} | ||
<!-- 3) Query the stored data using Semantic MediaWiki (#ask) --> | <!-- 3) Query the stored data using Semantic MediaWiki (#ask) --> | ||
{{#ask: [[-Has subobject::{{FULLPAGENAME}}]] | {{#ask: [[-Has subobject::{{FULLPAGENAME}}]] | ||
|? | |?event_id | ||
|? | |?event_created | ||
|?event_updated | |||
|?event_published | |||
|format=table | |format=table | ||
|headers=show | |headers=show | ||
|mainlabel=- | |mainlabel=- | ||
}} | }} |