Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/allow2/allow2php
Allow2 PHP SDK for OpenSource Parental Freedom
https://github.com/allow2/allow2php
child children composer control controls family freedom gaming limit limits parent parental parental-control quota social social-network time time-limit
Last synced: about 2 months ago
JSON representation
Allow2 PHP SDK for OpenSource Parental Freedom
- Host: GitHub
- URL: https://github.com/allow2/allow2php
- Owner: Allow2
- License: other
- Created: 2017-03-31T06:09:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-10T22:57:57.000Z (over 6 years ago)
- Last Synced: 2024-11-18T23:08:27.522Z (about 2 months ago)
- Topics: child, children, composer, control, controls, family, freedom, gaming, limit, limits, parent, parental, parental-control, quota, social, social-network, time, time-limit
- Language: PHP
- Homepage: https://Allow2.github.io
- Size: 1.22 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Allow2php
[![Join the chat at https://gitter.im/Allow2/Allow2php](https://badges.gitter.im/Allow2/Allow2php.svg)](https://gitter.im/Allow2/Allow2php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
pip: https://pypi.org/project/allow2/
composer: https://packagist.org/packages/allow2/allow2phprefer to https://github.com/Allow2/Allow2.github.io/wiki for more details.
todo: Port https://github.com/Allow2/Allow2node to a PHP library
(NOTE: Allow2WP wordpress plugin has an embedded implementation, so we can use that to extract the necessary parts into the library, but then also should have that plugin leverage this library - tease it out)Oh, and we should build this library to be easy to install via composer, packagist, etc
# Curl examples
to get you started:
## 1. Pairing
First, pair with Allow2 (this is using the username/password method):
```sh
curl -H "Content-Type: application/json" -X POST -d '{"user": "ALLOW2_ACCOUNT_EMAIL", "pass":"ALLOW2_ACCOUNT_PASS", "deviceToken": "jJ5GOIaJ028Ywt6K", "name":"Test Device 1" }' https://app.allow2.com:8443/api/pairDevice
```this returns a payload with information that you pass back to the app to persist for future use against the service:
```json
{
"status":"success",
"pairId":12345,
"token":"6742b233-de46-4c86-2ac9-7b9e5729f999",
"name":"Test Device 1",
"userId": 1234,
"children":[
{ "id":682, "name":"Bob" },
{ "id":691, "name":"Grace" },
{ "id":1795,"name":"Fred"}
]
}
```## 2. Checking and Logging Usage
```sh
curl -H "Content-Type: application/json" -X POST -d '{"userId": 1234, "pairToken":"6742b2f3-de46-4c86-8ac9-7b9e532cf999", "deviceToken": "jJ5GOIaJ028Ywt6K", "tz": "Australia/Brisbane", "childId": "682", "activities": [{ "id": 7, "log": true }] }' https://api.allow2.com:9443/serviceapi/check
```}