I don't see any particular reason not to add it, but there are some workarounds you can use in the meantime:
- Build a cache of all site information with the site URL as the key, and then look up the
api_site_parameter
value (and associated information) that way.
or
Use the fact that the domain name can be passed in as the value for
site
, and clean up the returnedsite_url
to fit, i.e.:
Use the fact that the domain name can be passed as a valid value for thevar api_site = network_user.site_url.substring( network_user.site_url.indexOf("//") + 2, network_user.site_url.length - 1 );
site
parameter, in all API routes that require it. EG:/2.2/answers?site=unix.stackexchange.com
Clean up the returned site_url
to fit, i.e.:
var api_site = network_user.site_url.substring(
network_user.site_url.indexOf("//") + 2,
network_user.site_url.length - 1
);