Title: API Endpoints
Author: meglio
Published: <strong>Август 7, 2015-ж.</strong>
Last modified: Август 14, 2015-ж.

---

Плагиндерди издөө

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://s.w.org/plugins/geopattern-icon/twig-anything-api-endpoints.svg)

# API Endpoints

 Автору [meglio](https://profiles.wordpress.org/meglio/)

[Жүктөө](https://downloads.wordpress.org/plugin/twig-anything-api-endpoints.zip)

 * [Кенен маалымат](https://ky.wordpress.org/plugins/twig-anything-api-endpoints/#description)
 * [Сын-пикирлер](https://ky.wordpress.org/plugins/twig-anything-api-endpoints/#reviews)
 *  [Орнотуу](https://ky.wordpress.org/plugins/twig-anything-api-endpoints/#installation)
 * [Development](https://ky.wordpress.org/plugins/twig-anything-api-endpoints/#developers)

 [Колдоо](https://wordpress.org/support/plugin/twig-anything-api-endpoints/)

## Сүрөттөө

Choose which of your site’s data to make available via WordPress API
 and in which
format.

#### Features

 * Customize API URLs: `http://mywordpress.com/my-api/name1` – change **my-api**
   and **name1** in the plugin settings
 * Set minimal capability permission individually for every API endpoint
 * Customize HTTP headers
 * Use any data from your sites’s MySQL database: posts/pages, custom posts, comments,
   settings, users, site options, post metadata, users, drafts, activity and much
   more
 * Turn any local file into an API (CSV, JSON, XML, you name it)
 * Fetch any data from 3rd party APIs and turn into your own API
 * Boost API speed with the caching system out of the box
 * Output API in any format, including, but not limited to, JSON, XML, RSS/ATOM,
   YAML and HTML.
 * Get full control over the API output by using a simple template language.
 * Two dedicated templates: 1) for successful API calls and 2) for API failures (
   e.g. authentication error)
 * Intelligent template editor with code highlighting and full screen mode

This is a free add-on to the
 [Twig Anything](https://twiganything.com/) WordPress
plugin.

## Скриншоттор

 * [[
 * The slick API Endpoints configuration panel with settings for error/success templates,
   URL names, capability roles set individually per API endpoint, and templates 
   to use for each API.
 * [[
 * HTTP headers configuration: by default, anti-cache headers are set, but you can
   add any headers depending on what format you want your API to output. It hints
   you about headers to use for most popular formats: JSON, XML, RSS and YAML.
 * [[
 * An API endpoint in JSON format that gets information from a local CSV file and
   converts it into API.
 * [[
 * Insufficient permissions when calling a protected API with a wrong username/password

## Орнотуу

#### Minimum Requirements

 * WordPress 3.6.1 or greater
 * PHP version 5.4 or greater
 * MySQL version 5.0 or greater
 * [Twig Anything](https://twiganything.com) WordPress plugin version 1.5 or greater

#### Automatic installation

Automatic installation is the easiest option as WordPress handles the file transfers
itself and you don’t need to leave your web browser. To do an automatic install 
of API Endpoints, log in to your WordPress dashboard, navigate to the Plugins menu
and click Add New.

In the search field type “API Endpoints” and click Search Plugins. Once you’ve found
the plugin, you can view details about it such as the the point release, rating 
and description. Most importantly, of course, you can install it by simply clicking“
Install Now”.

#### Manual installation

The manual installation method involves downloading the API Endpoints plugin and
uploading it to your webserver via your favourite FTP application. The WordPress
codex contains [instructions on how to do this here](https://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).

#### Updating

Automatic updates should work like a charm; as always though, ensure you backup 
your site just in case.

 1. Upload `twig-anything-api-endpoints.zip` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## FAQ.KG

  What formats can my API Endpoints output in?

JSON, XML, CSV (comma separated values), YAML and pretty much anything with just
a bit of config. You have full control of what is output and which format.

  How many API Endpoints can I create?

Create as many endpoints as you need. There are no limits!

  Can I control access to my API Endpoints?

Yes, you can configure a minimum user role required for each endpoint separately.
You will then pass `username` and `password` variables in your call to the API, 
which will be used to authenticate with your existing WordPress users.

  Can I configure access to each API Endpoint separately?

Yes, every single API Endpoint has its own optional minimal role required to access
the API.

  Should I create a separate WordPress user to access API Endpoints?

If your API is public and meant to be accessed by anyone, then no.

However, if you API needs authentication, then I recommend creating a separate WordPress
user and using its username/password to access the API. A separate WP account for
consuming your API would make it easier to switch it ON/OFF or change its permission
level accordingly when required.

  Can I configure the URL to my API?

By default, you would access your API endpoint by a URL like this:

    ```
    http://my-wordpress.com/api-endpoint/endpoint-name
    ```

… where `api-endpoint` is the common root URL, and `endpoint-name` is unique for
every endpoint. Both of these pieces are configurable in the settings screen.

  Can I control HTTP headers output by an API endpoint?

Yes, you can configure HTTP headers in the settings screen. To access it, click 
on the “Settings” menu and then on the “API Endpoints” sub-menu.

  What if API returns an error?

As any API, yours can return an error. For example, if someone tries to access a
protected API endpoint without appropriate authentication. If this is the case, 
the _Error Template_ from the settings screen will be used.

There is a default error template in JSON format in place, but you can easily tune
it to your own needs.

  How can I preview the API output?

In the _Settings_ screen, in front of every api endpoint there is an _“Open”_ button.
Clicking on it opens a new tab in your browser linking to the URL the API.

You can also use special tools to test you API, for example [Postman](https://www.getpostman.com/).

  Why does it require Twig Anything plugin?

Twig Anything is a super-powerful plugin that allows to fetch any data from anywhere
and display it in your WordPress site. It is universal and extensible, and already
has a lot of things like intelligent error handling and local cache. It also understands
Twig syntax, which allows for endless applications and various scenarios. “API Endpoints”
greatly benefits from all of this!

Last but not least, the developer behind both plugins is the same 🙂

  Can I turn a CSV file into an API?

Yes! You will need [CSV Format](https://wordpress.org/plugins/twig-anything-csv/)
add-on to read let it data from a CSV file.

  Can I turn someone else’s API into my own API?

Yes, just configure your Twig Template to fetch data from a URL and then output 
it either entirely or partially in your template.

## Сын-пикирлер

There are no reviews for this plugin.

## Contributors & Developers

“API Endpoints” is open source software. The following people have contributed to
this plugin.

Мүчөлөрү

 *   [ meglio ](https://profiles.wordpress.org/meglio/)

[Translate “API Endpoints” into your language.](https://translate.wordpress.org/projects/wp-plugins/twig-anything-api-endpoints)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/twig-anything-api-endpoints/),
check out the [SVN repository](https://plugins.svn.wordpress.org/twig-anything-api-endpoints/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/twig-anything-api-endpoints/)
by [RSS](https://plugins.trac.wordpress.org/log/twig-anything-api-endpoints/?limit=100&mode=stop_on_copy&format=rss).

## Өзгөртүүлөр

#### 1.1

 * Add new default HTTP header “Access-Control-Allow-Origin: *”
 * Add links to the Plugins screen for navigation convenience: “Settings” and “Support
   and community”
 * Check if Twig Anything plugin is installed and active and show a warning if it
   is not

#### 1.0

 * The first release

## Мета

 *  Нуска **1.1**
 *  Акыркы жаңыртуу **11 жыл мурун**
 *  Активдүү орнотуулар **10+**
 *  WordPress нускасы ** 3.6.1 же андан жогору **
 *  Tested up to **4.2.39**
 *  Тил
 * [English (US)](https://wordpress.org/plugins/twig-anything-api-endpoints/)
 * Тег:
 * [api](https://ky.wordpress.org/plugins/tags/api/)[api client](https://ky.wordpress.org/plugins/tags/api-client/)
   [integration](https://ky.wordpress.org/plugins/tags/integration/)[rest](https://ky.wordpress.org/plugins/tags/rest/)
   [RESTful](https://ky.wordpress.org/plugins/tags/restful/)
 *  [Advanced View](https://ky.wordpress.org/plugins/twig-anything-api-endpoints/advanced/)

## Рейтинг

Азырынча эч кандай сын-пикир жок.

[Your review](https://wordpress.org/support/plugin/twig-anything-api-endpoints/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/twig-anything-api-endpoints/reviews/)

## Мүчөлөрү

 *   [ meglio ](https://profiles.wordpress.org/meglio/)

## Колдоо

Комментарийлер барбы? Жардам керекпи?

 [Колдоо форумун көрүү](https://wordpress.org/support/plugin/twig-anything-api-endpoints/)