Download the PHP package native-network/social_json_api without Composer

On this page you can find all versions of the php package native-network/social_json_api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package social_json_api

Social JSON API

Social JSON API provides an API which can be used with the following entities:

It works out of the box for these entities. However you'll need to do some configuration to access the API (authentication and authorization).

Installation

  1. Enable this module and all its dependencies.
  2. The module will automatically create a folder outside your docroot (web/html) directory where you can store the public and private key combination. By default this is: private://oauth_api_keys/.
  3. If your site has a sitemanager role it will automatically assign a bunch of permissions to this role.
  4. Check if all the right entities are enabled in social_json_api_entity_type_alter().

Configuration

The API System which is implemented has multiple authentication grants available. These are all allowed in Open Social by default.

To determine which grant is applicable for your use-case please read the oauth2 documentation For demo purposes we assume you'll want the password grant, which means that you'll login with account details of a given user.

  1. Go to /admin/config/people/simple_oauth and configure the OAuth settings to your needs. Double check the expiration times and if the keys exist. During development you can set the access token expiration time on a higher value. Usually this should be below 300 seconds.
  2. Create a consumer on /admin/config/services/consumer/add
  3. Fill in at least:
    • Label: The label for your consumer (e.g. My CRM system)
    • User: leave this empty
    • New secret: Generate a secure string here (e.g. using Lastpass, but do remember this, you'll need this later)
    • Is confidential: yes
    • Is this consumer 3rd party?: yes
    • Redirect URL: leave empty
    • Scopes: select the roles you want to use here, e.g. Sitemanager (this determines the permissions for the API)
  4. After saving the consumer you'll go to the consumer overview where you can see the consumer uuid.

Authentication

Now you can get access to the API by doing a POST Request on /oauth/token with the following body:

Just fill in the client_id, client_secret, username and password accordingly. You will receive an access_token and refresh_token which you can use in subsequent requests, e.g. in refresh_token requests or you can use the same access_token during the expire time.

More info here: http://oauth2.thephpleague.com/authorization-server/resource-owner-password-credentials-grant/

Documentation

Some more information is available on your site on: /admin/config/opensocial/social-json-api

You will also find a link to the documentation for your API there. The documentation is automatically generated and displayed with ReDoc.


All versions of social_json_api with dependencies

PHP Build Version
Package Version
Requires drupal/simple_oauth Version ^3.0
drupal/schemata Version ^1.0
drupal/openapi_ui_redoc Version ^1.0
drupal/openapi_ui Version ^1.0
drupal/openapi Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package native-network/social_json_api contains the following files

Loading the files please wait ....