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
Task Search
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:
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.
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.
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.
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.
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.
GitHub Account
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 and thanks for reading,
Hen
Thank you for your contribution. You probably want to take a look at Rest API Design.
getProductData
has been called in its many APIs to get the sub-field which may be cached.getData
and many other APIs has a long chain in getting its field data, which may throw exception e.g. null pointer. The try-catch will hide the errors and prevent early identification of the risks - which is generally a bad idea.addUserToTheTeam
, have you thought about multiple requests i.e. race conditions?Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Chat with us on Discord.
[utopian-moderator]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you for your review, @justyy! Keep up the good work!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @dehenne! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
To support your work, I also upvoted your post!
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @dehenne!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hey, @dehenne!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @dehenne! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit