Skip to content

Commit

Permalink
Adds question resource documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
coconutcraig committed Jan 14, 2019
1 parent 9aafb04 commit 9defa80
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,52 @@ class Locations {
}
```

### Questions

##### Methods

- `for(services: number | number[] | string | string[])`

Set a filter which will tell the API to return questions which are specifically assigned to the given service identifier(s).

- `get()`

Send the API request using the pre-set filters.

- `on(page: number)`

Set the page offset which you want to view.

- `sortBy(sortable: string)`

Set a sorting string to determine how the returned results are sorted.

- `take(limit: number)`

Set the limit which you want returned.

##### Example

```javascript
import OpenApi from 'coconut-open-api-js';

class Questions {
constructor() {
this.api = new OpenApi();
}

async get() {
return await this.api
.questions
.for([1, 2, 3])
.on(2)
.sortBy('label,-required')
.take(10)
.get()
}
}
```

### Services

##### Methods
Expand Down

0 comments on commit 9defa80

Please sign in to comment.