Page MenuHomePhabricator

Update object models & placeholder text for pre-release demos of the Attribution API
Closed, ResolvedPublic3 Estimated Story Points

Description

Description

The Beta attribution endpoint currently serves 2 purposes: 1) Enable testing and feedback cycles by allowing people to call it directly, and 2) Serve as a demonstration of where we are headed and what the API will be able to do. As we continue in the APP cycle, there is growing interest in the Attribution framework and associated API. We are also increasingly finding that having the API preview is what actually makes the story land, and makes it clear how reusers might pull the data in a usable way, increasing the likelihood of framework adoption.

Although we are still iterating towards a solid MVP, we should include placeholder text for the areas of the framework and API that we expect to support, so that we can more easily get early feedback and adjust as needed.

Conditions of acceptance

  • Update last_modified to last_updated for consistency with the documented framework
  • Include placeholder object for trending signal
  • Update CTA data model & placeholder text
  • Update contributor count model --> Double check with Halley before doing this one
  • Update response schema to reflect new values, including validation tests
  • For all hardcoded values, make it clear this is a temporary solution and will be used for demonstrative purposes only (HACK TODO TEMPORARY --> Good rule of thumb is to include a link to a phab ticket for actual implementation as well (in this case, we can probably use the epic for now) //
  • [NEW ADDITION] Rename author field to credit so that is more generic and reusable for different forms of media.
NOTE: Do not include these values in translation configuration (eg: qqq) for now. We are still determining our overall language strategy for this and other APIs.

Implementation details

Trending
Trending will have two categories contained within it. Although we will not be populating the "relative" trending just yet, we expect "top" trending to come soon (see: https://phabricator.wikimedia.org/T418501)

"trust_and_relevance": {
  "last_modified": "2026-02-22T15:39:51Z",
  "page_views": 470381,
  "trending": {
    "top": {
        "read": boolean,
        "edited": boolean,
        "read_and_edited": boolean
    },
    "relative": {
        "read": boolean,
        "edited": boolean,
        "read_and_edited": boolean
     }
  }
}

Calls to action
Although there are 3 types of calls to action (participation, contribution, donation), they should reuse a common "call_to_action" model:

{
    "url": string
    "link_text": string,
    "description": string,
}

This means that an example, complete object may look like:

  "calls_to_action": {
    "donation_ctas": 
    	"default: {
	      "url": "https://donate.wikimedia.org/w/index.php?title=Special:LandingPage&country=US&uselang=en&wmf_medium=sidebar&wmf_source=donate&wmf_campaign=en.wikipedia.org",
	      "link_text": "Donate to Wikipedia",
	      "description": "Wikipedia is the backbone of the internet’s knowledge. If everyone reading this gave just a few dollars, we'd protect the future of free knowledge for everyone for years to come, in just in a few hours."
    	},
    	"foundation": {
	      "url": "https://donate.wikimedia.org",
	      "link_text": "Support the Wikimedia Foundation",
	      "description": "Wikimedia Foundation hosts the technology infrastructure that makes possible billions of visits to Wikipedia on a monthly basis. Since our founding in 2003, we have supported the hundreds of thousands of volunteer editors who edit, expand and curate the Wikimedia projects."
    	},
    	"special": {
	      "url": "https://donate.wikipedia25.org/",
	      "link_text": "Celebrate 25 years of free knowledge",
	      "description": "After 25 years, Wikipedia is still here. What started as a wildly ambitious and probably impossible dream is now an essential knowledge resource for humanity—funded by readers like you and filled with knowledge shared by volunteers all over the world."
    	}
    },
    "participation_ctas": { // NOTE: these CTAs have not yet been reviewed by owning teams; proceed with caution/check with Halley first
    	"download_app": {
	      "url": "https://play.google.com/store/apps/details?id=org.wikipedia", // Waiting to see if the apps team has an OS aware link we can use; defaulting to Android for now
	      "link_text": "Download the Wikipedia app",
	      "description": "Download the free Wikipedia app for the best way to explore knowledge on the go. The app delivers a rich, smooth mobile experience than with exclusive features designed to make discovering, reading, and engaging with the world's largest encyclopedia faster and more enjoyable than ever."
    	},
    	"create_account": {
	      "url": "https://auth.wikimedia.org/enwiki/wiki/Special:CreateAccount",
	      "link_text": "Create a Wikipedia account",
	      "description": "Create a free account and get more out of Wikipedia! While anyone can browse and even edit without signing in, an account unlocks a richer experience for readers and gives contributors the ability to build a reputation, save their work, and have a real say in how the world's largest encyclopedia takes shape."
    	},
        "learn_more": {
	      "url": "https://en.wikipedia.org/wiki/Help:Introduction_to_Wikipedia",  // <-- note that many Wikipedia projects have this page; we should try to pull the localised verison if we can
	      "link_text": "Learn more about Wikipedia",
	      "description": "Wikipedia is a free encyclopedia, written collaboratively by the people who use it. Since 2001, it has grown rapidly to become the world's largest reference website. Come learn how you can help shape its content and protect its future."
        }
<REMOVE TALK_PAGE>
    }
  }

Contributor counts --> PLEASE HOLD ON THIS CHANGE FOR NOW
Update the data model to be a complex object:

"trust_and_relevance": {
  "last_modified": "2026-03-02T23:54:16Z",
  "page_views": 465902,
  "contributor_counts": {
      "total_unique": 0,
      "logged_in_users": 0,
      "anonymous_users": 0,
      "bots": 0
  }
},

Event Timeline

HCoplin-WMF set the point value for this task to 3.
pmiazga subscribed.

Bringing back to sprint as it was an unintentional change.

Change #1254309 had a related patch set uploaded (by Aghirelli; author: Aghirelli):

[mediawiki/extensions/WikimediaCustomizations@master] Attribution: Update object models and placeholder text for pre-release demos

https://gerrit.wikimedia.org/r/1254309

@AGhirelli-WMF -- Could we make one more small adjustment to this? I forgot to include renaming author to credit as a more generic name. Let me know if you can pull it in here, or I can file a separate ticket if you prefer.

@AGhirelli-WMF -- Could we make one more small adjustment to this? I forgot to include renaming author to credit as a more generic name. Let me know if you can pull it in here, or I can file a separate ticket if you prefer.

Yes, I'll update it quickly :)

Change #1254309 merged by jenkins-bot:

[mediawiki/extensions/WikimediaCustomizations@master] Attribution: Update object models and placeholder text for pre-release demos

https://gerrit.wikimedia.org/r/1254309

Marking as resolved to close MWI-Sprint-30 (2026-03-24 to 2026-04-07)