Commit b0c375c3 authored by Björn Hjortsten's avatar Björn Hjortsten

Added a readme

Described how to install, authenticate and other things.
parent f38267c6
# templafy-apiwrapper
# Templafy Api Wrapper
A simple API wrapper for Templafy
\ No newline at end of file
A simple API wrapper for Templafy Allows for simple communication from PHP with Templafy with
minimal setup.
## Requirements
* PHP 7.2+
* Guzzle 6.1+
## Installation
`composer require qbnk/templafy-apiwrapper ^0.1`
## Authorization
Templafy's API uses OAuth2 with the client credentials flow. This means that you will need a *client id* and a *client
secret* to be able to authorize with and use the API. The *client id* is the subdomain of the templafy instance. If the
instance domain is ``, the *client id* is `customer`. The *client secret* is available in the
Templafy administration.
### Example
To create an instance that can authorize with the API, simply pass a `Credentials` instance with the *client id* and
*client secret* to the `TemplafyApi` constructor. The library will then handle the rest.
$api = new TemplafyApi(new Credentials('customer', 'client secret'));
## FAQ
##### How do I create a folder in the absolute root?
You have to pass a `parentFolderId` for all folders that shall be created. This value is the id of the image library
itself when creating root folders. You can find this value in the URL in the Templafy administration when viewing the
image library. It is the query parameter `categoryId`.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment