2017 © Pedro Peláez
 

library php-slack-api

Access your Slack Team's API through PHP objects

image

hnhdigital-os/php-slack-api

Access your Slack Team's API through PHP objects

  • Tuesday, July 4, 2017
  • by bluora
  • Repository
  • 2 Watchers
  • 5 Stars
  • 9,506 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 47 Versions
  • 19 % Grown

The README.md

   _____ _            _
  / ____| |          | |
 | (___ | | __ _  ___| | __
  \___ \| |/ _` |/ __| |/ /
  ____) | | (_| | (__|   <
 |_____/|_|\__,_|\___|_|\_\

Access your Slack Team's API through PHP objects., (*1)

Latest Version Total Downloads Software License, (*2)

This package has been adapted from cleentfaar/slack by H&H|Digital, an Australian botique developer. Visit us at hnh.digital., (*3)

1.0.0 release

Please note that from the 1.0.0 release this package's namespace (and folder structure) will change from CL\Slack to HnhDigital\SlackApi., (*4)

From v1.0.0 all the payloads and responses will be matched with the Slack API and missing api methods (listed below) will be completed., (*5)

Documentation

  • Getting started - Before you use this library, you need to generate a token or setup oAuth.
  • Installation - Information on installing this library through composer or as a git submodule.
  • Usage - A few simple examples on how to access the Slack API using this library
  • API methods - Detailed information on each of Slack's API methods and how to access them using this library's Payload classes.
  • Events - Examples for listening to events fired by the ApiClient

Features

  • Access all of Slack's API methods with dedicated payload classes (see usage documentation)
  • Payloads and responses follow the same definitions as described in the official documentation (with a few exceptions where I think it would make a better distinction).
  • Data between you and Slack is serialized using the JMS Serializer package, allowing fully spec-ed PHP objects to be used for working with the API.
  • Code has been highly abstracted to support re-use in more specific implementations (see SlackBundle)

Unit testing

Currently unit testing is broken (as per imported repo cleentfaar/slack). This will be updated to the latest version shortly., (*6)

Feel free to fix with a PR., (*7)

Up-to-date methods

The following methods have been reviewed and updated:, (*8)

  • chat.postMessage (Last reviewed: June 23, 2017)
  • chat.update (Last reviewed: June 23, 2017)
  • oauth.access (Last reviewed: June 21, 2017)
  • users.identity (Added: June 25, 2017)

Feel free to review a method and update the README with a PR., (*9)

Missing API methods

The following methods have not been implemented., (*10)

Feel free to add a PR., (*11)

  • auth.revoke
  • channels.replies
  • chat.meMessage
  • chat.unfurl
  • dnd.endDnd
  • dnd.endSnooze
  • dnd.setSnooze
  • dnd.teamInfo
  • files.comments.add
  • files.comments.delete
  • files.comments.edit
  • files.delete
  • files.revokePublicURL
  • files.sharedPulbicURL
  • im.replies
  • mpim.close
  • mpim.history
  • mpim.list
  • mpim.mark
  • mpim.open
  • mpim.replies
  • pins.add
  • pins.list
  • pins.remove
  • reactions.add
  • reactions.list
  • reactions.remove
  • reminders.add
  • reminders.complete
  • reminders.delete
  • reminders.info
  • reminders.list
  • rtm.connect
  • stars.add
  • stars.remove
  • team.accessLogs
  • team.billableInfo
  • team.integrationLog
  • team.profile.get
  • usergroups.create
  • usergroups.disable
  • usergroups.enable
  • usergroups.list
  • usergroups.update
  • usergroups.users.list
  • usergroups.users.update
  • users.deletePhoto
  • users.setPhoto
  • users.profile.get
  • users.profile.set

Methods that need removing

The following methods no longer exist in the API:, (*12)

  • users.adminInvite

FAQ

Why am I getting a cURL 60 error when attempting to connect to the Slack API?

Under the hood this library uses Guzzle to connect to the Slack API, and Guzzle's default method for sending HTTP requests is cURL., (*13)

The full error code is CURLE_SSL_CACERT: Peer certificate cannot be authenticated with known CA certificates and may be due, especially on Windows or OS X, to Guzzle not being able to find an up to date CA certificate bundle on the operating system., (*14)

To fix this you first create the Guzzle client manually using an alternative CA cert bundle, or disabling peer verification (not recommended for security reasons), and pass it to the API Client., (*15)

$client = new \GuzzleHttp\Client();
$client->setDefaultOption('verify', 'C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt');

// continue as normal, using the client above

$apiClient =  new ApiClient('api-token-here', $client);

If you get a different error code you can look at the list of cURL error codes, or consult the Guzzle documentation directly., (*16)

Contributing

Please see CONTRIBUTING for details., (*17)

Credits

License

The MIT License (MIT). Please see License File for more information., (*18)

The Versions

20/09 2015
16/05 2015

0.16.1

0.16.1.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

21/02 2015

0.15.3

0.15.3.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

21/02 2015

0.15.2

0.15.2.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

18/02 2015

0.15.1

0.15.1.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

15/02 2015

0.14.5

0.14.5.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

15/02 2015

0.14.4

0.14.4.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

15/02 2015

0.14.3

0.14.3.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

14/02 2015

0.14.2

0.14.2.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

14/02 2015

0.14.1

0.14.1.0 http://cleentfaar.github.io/slack/

Access your Slack Team's API through PHP objects

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

08/02 2015
08/02 2015

0.13.1

0.13.1.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

31/01 2015

0.12.3

0.12.3.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

21/01 2015

0.12.2

0.12.2.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

14/12 2014

0.12.1

0.12.1.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

09/12 2014

0.11.4

0.11.4.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

06/12 2014

0.10.3

0.10.3.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

02/12 2014

0.10.1

0.10.1.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

30/11 2014

0.10.0

0.10.0.0

A PHP library providing easy access to the Slack API

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api chat

05/08 2014

0.9.4

0.9.4.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

api slack

18/07 2014

0.9.3

0.9.3.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

api slack

17/07 2014

0.9.2

0.9.2.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

api slack

17/07 2014

0.9.2b

0.9.2.0-beta

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

api slack

17/07 2014

0.9.1

0.9.1.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

api slack

02/07 2014

0.2

0.2.0.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api

01/07 2014

0.1

0.1.0.0

A PHP library providing integration with the Slack API and webhooks

  Sources   Download

MIT

The Requires

 

The Development Requires

slack slack api