Mediawiki API error: Unrecognized value for parameter 'prop': extracts - mediawiki

I have a new installation of mediawiki. I am trying to use the API to simply get an article. The API url I am using is:
https://example.com/mediawiki/api.php?action=query&format=json&prop=extracts&titles=Vendor_cisco
Upon going to that URL I get: Unrecognized value for parameter 'prop': extracts
This seems odd because all of the following urls do work and return the right data:
https://example.com/mediawiki/api.php?action=query&format=json&prop=links&titles=Vendor_cisco
https://example.com/mediawiki/api.php?action=query&format=json&prop=categories&titles=Vendor_cisco
https://example.com/mediawiki/api.php?action=query&format=json&prop=revisions&titles=Vendor_cisco
How do I get the body and text from my article? I was under the impression prop=extracts is what is used.

prop=extracts is part of TextExtracts extension (formerly MobileFrontend extension). If you don't have that extension installed, you won't be able to use prop=extracts.

Related

Twitter API for Non-public/organic/promoted metrics in Google Script

I'm trying to use the Twitter API in Google Script to get the non-public metrics of my posts.
I believe have done all of the authentication properly since I am able to get the information when using Postman. I have generate a consumer_key, a consumer_secret, an access_token, and a token_secret.
According to the twitter documentation , I MUST use Oauth1.0 (https://developer.twitter.com/en/docs/twitter-api/metrics).
In order use the Oauth1, I used Google's own script for Twitter Oauth1 (https://developers.google.com/google-ads/scripts/docs/examples/twitter-oauth10).
I was able to take that code (along with the library it required) and successfully retrieve the tweets for my username.
My attempt to get the non_public metric was replacing the "https://api.twitter.com/1.1/statuses/user_timeline.json" with the GET request I had from POSTMAN but it returned a "401 error".
I have a hunch that I can't just replace that url with my own but I am unsure how to approach it.
In summary:
Tokens/Twitter Authorization/GET request are written properly since they work in Postman
Google Script is writing properly since the default URL works
Unsure how to replace the default url to accomplish different tasks
Ended up figuring it it out!
I was not supposed to pass the entire url as a replacement for "https://api.twitter.com/1.1/statuses/user_timeline.json".
It is supposed to be replaced by the "base" url. In my case this was "https://api.twitter.com/2/tweets".
I then had to change the variable "params" that feed into it.
note that the params is from the code provided by Google in my original post
They have to be in the following format (https://developer.twitter.com/en/docs/tutorials/twitter-api-google-sheets):
params = {
"tweet.fields": "author_id,created_at,lang",
"ids": "21,1293593516040269825,1334542969530183683",
}
I was able to add my own fields such as "non_public_metrics,organic_metrics" to get:
params = {
"tweet.fields": "author_id,created_at,lang,non_public_metrics,organic_metrics",
"ids": "21,1293593516040269825,1334542969530183683",
}
I hope this helps someone someday :)

MediaWiki: How to resolve "descriptionmsg" value retrieved via API?

Via http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions you can retrieve information about the MediaWiki extensions installed. The result format is documented at https://www.mediawiki.org/wiki/API:Siteinfo and states that for each extension descriptionmsg contains a system message name. This is not the description itself but a key to a description string.
My question is: I have the key from descriptionmsg, now how do I obtain the description string (via the API)?
MediaWiki has an API module in its action API called allmessages, it can be called like https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc
Check out its documentation here: https://www.mediawiki.org/wiki/API:Allmessages
You can retrieve the contents of https://en.wikipedia.org/wiki/MediaWiki:[descriptionmsg_value]
Replace [descriptionmsg_value] with the actual value. For example given "descriptionmsg":"timedmediahandler-desc" the related page is https://en.wikipedia.org/wiki/MediaWiki:timedmediahandler-desc.
There are several ways to get the contents of a page. Refer to API:Get the contents of a page for more information.

BIM360Docs API Export Document with markup not working?

As shown in the image, I have tried API provided by BIM360 from the following link:
https://forge.autodesk.com/en/docs/bim360/v1/tutorials/document-management/export-pdf-from-docs/
But I am not able to run API 'Export files with markups' and received an error as shown in the image.
I have also mentioned project id and version id which is used in API call.
How can I solve this issue?
please encode your version id to URL-safe string with Uri.EscapeUriString(String). There are some invalid string for a URL in the version id.

Content Property error on confluence cloud error

i am developing an addon on confluence cloud and i needed to store a value .i am persuing this tuto in the link bellow https://developer.atlassian.com/static/connect/docs/latest/modules/confluence/content-property.html
after declaring this value "ideation " in section "confluenceContentProperties" in my descriptor json file, i get this error in my console
The add-on descriptor failed to validate against the schema. Please confirm this add-on is intended for use with Confluence and then contact the add-on vendor.
/confluenceContentProperties/0: object has missing required properties (["key"])
You also need to update atlassian-connect.json file and ensure that the values are correct. You can also validate your json file with this validator.

Mediawiki API error: "Unrecognized value for parameter 'prop': extracts"

I`am using the Mediawiki API offline on my server.
I installed everything and it works but if i try a query it returns the error: "Unrecognized value for parameter 'prop': extracts" than i installed the TextExtracts extension and also the MobileFrontend extension, but it's still not working.
I tried this from the answer in this question.
My url:
api.php?action=parse&page=Paul_McCartney&prop=extracts&format=xml
error:
http://prntscr.com/9y6df7
Mediawiki versions:
http://prntscr.com/9y6d01
The TextExtracts extension implements a query Api module, so you can't use the extracts prop with the parse action. Instead of your url, you can use:
api.php?action=query&page=Paul_McCartney&prop=extracts&format=xml
(see the action parameter, which changed from parse to query)
to get the extracts prop.