<commit_before>MessageBird's REST API for Go
=============================
This repository contains the open source Go client for MessageBird's REST API. Documentation can be found at: https://www.messagebird.com/developers/go.

Requirements
------------
- [Sign up](https://www.messagebird.com/en/signup) for a free MessageBird account
- Create a new access key in the developers sections
- An application written in Go to make use of this API

Installation
------------
The easiest way to use the MessageBird API in your Go project is to install it using *go get*:

```
$ go get github.com/messagebird/go-rest-api/messagebird
```

If this doesn't work, you probably haven't set your [GOPATH](https://code.google.com/p/go-wiki/wiki/GOPATH) variable.

Examples
--------
We have put some self-explanatory examples in the [examples](https://github.com/messagebird/go-rest-api/tree/master/examples) directory, but here is a quick example on how to get started. Assuming the **go get** installation worked, you can import the messagebird package like this:

```go
import "github.com/messagebird/go-rest-api/messagebird"
```

Then, create an instance of **messagebird.Client**:

```go
mb := messagebird.New("test_gshuPaZoeEG6ovbc8M79w0QyM")
```

Now you can query the API for information or send data. For example, if we want to request our balance information you'd do something like this:

```go
// Request the balance information, returned as a Balance object.
balance, err := mb.Balance()
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

// Check for errors returned as JSON.
if len(balance.Errors) != 0 {
	for _, error := range balance.Errors {
		fmt.Println("  code        :", error.Code)
		fmt.Println("  description :", error.Description)
		fmt.Println("  parameter   :", error.Parameter)
	}
	os.Exit(1)
}

fmt.Println("  payment :", balance.Payment)
fmt.Println("  type    :", balance.Type)
fmt.Println("  amount  :", balance.Amount)
```

This will give you something like:
```shell
$ go run example.go
  payment : prepaid
  type    : credits
  amount  : 9 
```

Please see the other examples for a complete overview of all the available API calls.

Documentation
-------------
Complete documentation, instructions, and examples are available at:
[https://www.messagebird.com/developers/go](https://www.messagebird.com/developers/go).

License
-------
The MessageBird REST Client for Go is licensed under [The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause). Copyright (c) 2014, MessageBird<commit_msg>Update the README to reflect the changes<commit_after>MessageBird's REST API for Go
=============================
This repository contains the open source Go client for MessageBird's REST API. Documentation can be found at: https://www.messagebird.com/developers/go.

Requirements
------------
- [Sign up](https://www.messagebird.com/en/signup) for a free MessageBird account
- Create a new access key in the developers sections
- An application written in Go to make use of this API

Installation
------------
The easiest way to use the MessageBird API in your Go project is to install it using *go get*:

```
$ go get github.com/messagebird/go-rest-api
```

If this doesn't work, you probably haven't set your [GOPATH](https://code.google.com/p/go-wiki/wiki/GOPATH) variable.

Examples
--------
We have put some self-explanatory examples in the [examples](https://github.com/messagebird/go-rest-api/tree/master/examples) directory, but here is a quick example on how to get started. Assuming the **go get** installation worked, you can import the messagebird package like this:

```go
import messagebird "github.com/messagebird/go-rest-api"
```

Then, create an instance of **messagebird.Client**:

```go
client := messagebird.New("test_gshuPaZoeEG6ovbc8M79w0QyM")
```

Now you can query the API for information or send data. For example, if we want to request our balance information you'd do something like this:

```go
// Request the balance information, returned as a Balance object.
balance, err := client.Balance()
if err != nil {
	fmt.Println(err)
	os.Exit(1)
}

// Check for errors returned as JSON.
if len(balance.Errors) != 0 {
	for _, error := range balance.Errors {
		fmt.Println("  code        :", error.Code)
		fmt.Println("  description :", error.Description)
		fmt.Println("  parameter   :", error.Parameter)
	}
	os.Exit(1)
}

fmt.Println("  payment :", balance.Payment)
fmt.Println("  type    :", balance.Type)
fmt.Println("  amount  :", balance.Amount)
```

This will give you something like:
```shell
$ go run example.go
  payment : prepaid
  type    : credits
  amount  : 9 
```

Please see the other examples for a complete overview of all the available API calls.

Documentation
-------------
Complete documentation, instructions, and examples are available at:
[https://www.messagebird.com/developers/go](https://www.messagebird.com/developers/go).

License
-------
The MessageBird REST Client for Go is licensed under [The BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause). Copyright (c) 2014, 2015, MessageBird
{'fraction_non_alphanumeric': 0.13801929513683797, 'fraction_numerical': 0.006694231147863753, 'mean_word_length': 3.8705656759348033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '390557', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1473, 'n_words': 543}