# wp-data-access/5.5.84/assets/js/wpda_rest_api.js

WP Data Access – App Builder for Tables, Forms, Charts, Maps &amp; Dashboards, version 5.5.84. 24 lines.

- Page: https://pluginprobe.com/plugins/wp-data-access/5.5.84/code/assets/js/wpda_rest_api.js
- Raw: https://pluginprobe.com/plugins/wp-data-access/5.5.84/raw/assets/js/wpda_rest_api.js
- Modified: 2026-09-16T18:01:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-data-access/5.5.84/code/assets/js/wpda_rest_api.js#L10-L20`.

```javascript
function wpda_rest_api(path, data, callbackOk, callbackError, method = "POST") {
	jQuery.ajax({
		url: wpApiSettings.root + wpdaApiSettings.path + "/" + path,
		method: method,
		beforeSend: function (xhr) {
			xhr.setRequestHeader("X-WP-Nonce", wpApiSettings.nonce);
		},
		data: data
	}).done(function(response) {
		if (callbackOk!==undefined) {
			callbackOk(response)
		} else {
			console.error("Missing API callback. Server response:")
			console.error(response)
		}
	}).fail(function(response) {
		if (callbackError!==undefined) {
			callbackError(response)
		} else {
			console.error("Missing API callback. Server response:")
			console.error(response)
		}
	})
}
```
