Product API implementation into the PHP Client for Makerlog

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@dehenne·
0.000 HBD
Product API implementation into the PHP Client for Makerlog
Product API implementation into the PHP Client for Makerlog
======

As already mentioned in the last posts, I develop the PHP client for Makerlog in my spare time. Makerlog is the dead-simple task log that helps you stay productive and ship faster. There you can meet other makers and share your progress.

The last days I finished the Product API and integrated an undocumented search of tasks.

#### Repository

- https://github.com/pcsg/pcsg-makerlog-php-client
- Licence: GPL-3.0+


### New Features

#### What feature(s) did you add?

- I implemented the product API.
- `/products/ GET, POST
- `/products/{slug}/` GET, PATCH, DELETE
- `/products/{slug}/leave/`
- `/products/{slug}/people/`
- `/products/{slug}/projects/`
- `/products/{slug}/stats/`
- I implemented the tasks search API
- `/search/tasks/?q=`

#### How did you implement it/them?

The implementation is done with the following commits

**Products**

- [f958c8a](https://github.com/pcsg/pcsg-makerlog-php-client/commit/f958c8a140c92c66af3f43f448cd5878523aab0b)
- [47452cb](https://github.com/pcsg/pcsg-makerlog-php-client/commit/47452cb0fe7675baab284a5771dc79d6c7ac0391)
- [2b26022](https://github.com/pcsg/pcsg-makerlog-php-client/commit/2b26022d5837a58074b2e2d126da9afbe835dcc1)
- [a7e17c7](https://github.com/pcsg/pcsg-makerlog-php-client/commit/a7e17c7351fd5144e41c393bbb20e0bfd2eabaf4)
- [77a3fef](https://github.com/pcsg/pcsg-makerlog-php-client/commit/77a3fef7974f1480b31cdfe0edb8e25f7a62f3d6)

**Task Search**

- [b9b1793](https://github.com/pcsg/pcsg-makerlog-php-client/commit/b9b1793519df4082f46aaf496b8ee9457504e6b0)
- [fcafbd4](https://github.com/pcsg/pcsg-makerlog-php-client/commit/fcafbd4b444e9e9c9f34bf4bec5659e5812139cd)

Like in the last posts, I will go into the API a little bit. The complete API documentation is available under: https://github.com/pcsg/pcsg-makerlog-php-client/blob/master/docs/products.md

##### Products

The first thing you want to do, of course, is create a product. You have to know that some things are necessary for a product. For example, every product must have a project. Since I found this very annoying at the product creation, I automated the creation of an associated project.

Of course you can also create a project yourself and assign it to the product, that's no problem.

The easiest way to create a product is the following way:

![1.png](https://cdn.steemitimages.com/DQmeQgWbjQTomn4j5u3CPdKio34rwa6CPN3k2V7dvSzteSg/1.png)

*This example creates a product and the first project is created from the name of the product.*

However, if you want to create a product and already have a project, you can also pass this on.

![2.png](https://cdn.steemitimages.com/DQmTkrybiXub6QEagynJusHinNqqA7V4vjEgufp7uRGnUed/2.png)

In the complete API I have tried to ensure continuity. Therefore the getting of a product is as easy as the getting of a task or a project.

![3.png](https://cdn.steemitimages.com/DQmVLKiLMg8iibT5T3BUZi3mKcFkK1fLKnzJHBmtA8rbSKb/3.png)

One of the most beautiful features that have been added to Makerlog in the last weeks is the team building. It is now possible to assign other users to your product since one or two weeks. With the API client this is very easy to implement.

![4.png](https://cdn.steemitimages.com/DQmUhNzCzsEaB1UHY6XsXyDuVHmHUCC1JYqyns3jWpPyyZi/4.png)

If you want to work with the product or to read different data from it, you should take a look at all the getter methods. 

![5.png](https://cdn.steemitimages.com/DQmPhrQaJFux3A1NafFQwGze9ZBJU42cpdKcMzELK4ryjZY/5.png)

##### Task search

As a little goodie, I got a task request if I can integrate the task search API. This API is not documented but the basic usage is now built in.  I don't know if there are other parameters at the moment, but this will be clarified in the next days.

![6.png](https://cdn.steemitimages.com/DQmZi3nxvk2cWpmptpiq8KWUwmc2uyYHb9yfu1wQKWX5rAM/6.png)

#### GitHub Account

- https://github.com/dehenne


##### Future

The goal for the first version is next week at the latest. For version 1.0 the user API is still missing, which I have to check  but it is 50% ready and should be usable in the next days. After that I will introduce a dozen php unit tests to make the client stable.

That was it for today already, I hope I could give a little insight into the PHP client of Makerlog.

Have fun in [Makerlog](https://getmakerlog.com/) and thanks for reading,
Hen
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,