See the Wix Data API for details and code example snippets.
Hi, I’ve checked these and knows how to implement. But I didn’t see anywhere writeen clearly.
Let’s say I want to get the data from a collection. If use the query method, then is this right to say that I’ve worked with REST API?
@wix-expert-velo-cert No, the Wix Data API is available right from the site via an import statement. For information on using the Wix Data API, see the Wix Data with Velo . You can also play with a wide variety of data examples .
@yisrael-wix Thanks for the clarification. So, I need help with this instruction.
Instruction:
Contacts API - Expose an API endpoint for getting all the contacts, and another endpoint for deleting a contact.
- contacts : here contacts are stored in a collection say “directory”, so this is not a site member type of data.
Now, I’ve been said to use Contacts API using REST API method. I don’t understand how should I proceed this?
I can pull the data from collection using either directing linking the elements or by using velo coding (which you is an import method). I don’t think there is another way.
Do you think that instructions are wrong or I’m missing something because of lack of knowledge?
See the article Velo: Exposing a Site API with HTTP Functions on information on exposing an API on a site. In the API that you want to expose according the instructions that you received), you would call the wix-crm-backend API to provide the data that your API returns to the client.
The following examples demonstrate exposing an API on a site:
Thanks for the great help!