Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FooBarSprocket offers two public methods and one private method. Both FooBarSprocket::create() and FooBarSprocket::delete() are made available via the API at the following URLs, respectively:

Note
titleUse CamelCase Names

We highly recommend using CamelCase when referencing models. This behavior is required for plugin models since version 4.0.

No Format
(Supported by all Blesta versions):
https://yourdomain.com/installpath/api/FooBar.FooBarSprocket/create.json?vars[price]=1.99
https://yourdomain.com/installpath/index.php/api/FooBar.FooBarSprocket/delete.json?sprocket_id=123

(Supported by Blesta versions pre-4.0):
https://yourdomain.com/installpath/api/foo_bar.foo_bar_sprocket/create.json?vars[price]=1.99
https://yourdomain.com/installpath/index.php/api/foo_bar.foo_bar_sprocket/delete.json?sprocket_id=123
Info
titleThe API respects your authority
Only public model methods are accessible via the API, protected and private methods are not.

Each plugin may create any number of models. To avoid name conflicts with other plugins and with core Blesta models, plugin models should be named by prepending the plugin name to the model as in the example above (FooBarSprocket).