The Published Site URLs API allows you to retrieve links to a published site, including the site's primary and secondary URLs, and their language info.
On occasion, you might want to direct a Wix user to the published site - for example, to the site's homepage in a secondary language. With this API, you can easily access the URLs to their published site.
This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.
You might choose to direct Wix users from within your app to the published site. To do this:
The Published Site URLs object provides a list of URLs for the published site.
List of published site URLs. This array will be empty if the site isn't published.
Retrieves a list of a site's published URLs. If a site hasn't been published, the call returns an empty array.
You can only call this method when authenticated as a Wix app or Wix user identity.
URL type filter.
Default: ALL
Whether to return only the site's primary URL.
Default: true
.
Whether to return language subdomains hosted by Wix Multilingual.
Default: true
.
List of published site URLs. This array will be empty if the site isn't published.
curl -X GET \
'https://www.wixapis.com/urls-server/v2/published-site-urls' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
{
urls: [
"urlType" : "Premium",
"primary" : true,
"url": "https://www.your-domain.com",
"multilingualInfo": {
"languageCode": "en",
"defaultLanguage": true
}
]
There are 3 errors with this status code:
See the entire list and learn more about Wix errors.