Docs & API market
Connecting your site or app to be maintained by DasHttp involves a few simple steps: register your website, authenticate with our platform, and make API requests. With our advanced "-{page}" slug, we render your website code to a static file, ensuring enhanced security, improved performance, and simplified maintenance. You can sit back and relax while DasHttp takes care of maintaining your website for you.
JavaScript
Step 1: Registering Your Website
To get started with the Third Party Integration API, you'll first need to register your application with your platform. Here's some example code to do that:
const axios = require('axios');
const APP_ID = 'your_app_id';
const APP_SECRET = 'your_app_secret';
const registerApp = async () => {
const response = await axios.post('https://www."oem".com/_api/applications/v1/register', {
appId: APP_ID,
appSecret: APP_SECRET,
permissions: ['OWNER']
});
console.log(response.data);
};
registerApp();
Step 2: Authenticating with Platform
Once you've registered your application, you'll need to authenticate with your platform in order to access user data. Here's some example code to do that:
const axios = require('axios');
const APP_ID = 'your_app_id';
const APP_SECRET = 'your_app_secret';
const authenticate = async (instance) => {
const response = await axios.post('https://www.wix.com/_api/apps/' + APP_ID + '/auth/info', {
instance: instance
});
const token = response.data.access_token;
return token;
};
const token = authenticate('your_instance_id');
console.log(token);
Step 3: Making API Requests
Once you've authenticated with your platform, you can start making API requests. Here's some example code to get a list of sites that the user has authorized your application to access:
const axios = require('axios');
const APP_ID = 'your_app_id';
const APP_SECRET = 'your_app_secret';
const authenticate = async (instance) => {
const response = await axios.post('https://www.wix.com/_api/apps/' + APP_ID + '/auth/info', {
instance: instance
});
const token = response.data.access_token;
return token;
};
const token = authenticate('your_instance_id');
const getSites = async () => {
const response = await axios.get('https://www.wix.com/_api/sites/v1/authorized', {
headers: {
Authorization: 'Bearer ' + token
}
});
console.log(response.data);
};
getSites();
import wixLocation from 'wix-location';
$w.onReady(function () {
wixLocation.to('http://www.{site-url}.com/-home');
});
