Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Add documentation and fix github url repo in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
germanrcuriel committed Mar 31, 2015
1 parent 05d56d4 commit f374d13
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.2 (2015-03-31)

- Fix github's repo url on package.json
- Added documentation for `api` resource

## 0.0.1 (2015-03-30)

First commit
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ $ npm install slack-api-client

## API and documentation

- API:
- [api.test - Checks API calling code](docs/api.md#apitest---checks-api-calling-code)

- Work in progress. Documentation will be available shortly.

More information at [Slack API Documentation](https://api.slack.com/methods/)
Expand Down
62 changes: 62 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# API

## api.test - Checks API calling code

####Arguments:

| Argument | Example | Required | Description |
| -------- | ---------- | -------- | -------------------------- |
| `error` | `my_error` | Optional | Error response to return |
| `foo` | `bar` | Optional | Example property to return |

####Example:

CoffeeScript

```coffeescript
slack.api.api.test
person: 'John Doe'
, (err, res) ->
throw err if err
console.log res
```

JavaScript

```javascript
slack.api.api.test({
person: 'John Doe'
}, function (err, res) {
if (err) { throw err; }
console.log(res);
});
```

####Response:

```json
{
"ok": true,
"args": {
"person": "John Doe"
}
}
```

If called with an `error` argument an error response is returned:

```json
{
"ok": false,
"error": "my_error",
"args": {
"error": "my_error"
}
}
```

###Errors:

This method has no expected error responses. However, other errors can be returned in the case where the service is down or other unexpected factors affect processing. Callers should always check the value of the ok params in the response.

===
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slack-api-client",
"description": "A Slack API Client",
"version": "0.0.1",
"version": "0.0.2",
"author": "Germán Robledo <[email protected]>",
"main": "./lib/slack.js",
"dependencies": {
Expand Down Expand Up @@ -30,6 +30,6 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/germanrcuriel/slack-client.git"
"url": "git://github.com/germanrcuriel/slack-api-client.git"
}
}

0 comments on commit f374d13

Please sign in to comment.