1 ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) |
1 ![SendGrid Logo](twilio_sendgrid_logo.png) |
2 |
2 |
3 [![Build Status](https://travis-ci.org/sendgrid/rest.svg?branch=master)](https://travis-ci.org/sendgrid/rest) |
3 [![Build Status](https://travis-ci.com/sendgrid/rest.svg?branch=main)](https://travis-ci.com/sendgrid/rest) |
4 [![GoDoc](https://godoc.org/github.com/sendgrid/rest?status.png)](http://godoc.org/github.com/sendgrid/rest) |
4 [![GoDoc](https://godoc.org/github.com/sendgrid/rest?status.png)](http://godoc.org/github.com/sendgrid/rest) |
5 [![Go Report Card](https://goreportcard.com/badge/github.com/sendgrid/rest)](https://goreportcard.com/report/github.com/sendgrid/rest) |
5 [![Go Report Card](https://goreportcard.com/badge/github.com/sendgrid/rest)](https://goreportcard.com/report/github.com/sendgrid/rest) |
6 [![Email Notifications Badge](https://dx.sendgrid.com/badge/go)](https://dx.sendgrid.com/newsletter/go) |
6 [![Email Notifications Badge](https://dx.sendgrid.com/badge/go)](https://dx.sendgrid.com/newsletter/go) |
7 [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) |
7 [![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid) |
8 [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/rest.svg)](https://github.com/sendgrid/rest/graphs/contributors) |
8 [![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/rest.svg)](https://github.com/sendgrid/rest/graphs/contributors) |
9 [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt) |
9 [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) |
10 |
10 |
11 **Quickly and easily access any RESTful or RESTful-like API.** |
11 **Quickly and easily access any RESTful or RESTful-like API.** |
12 |
12 |
13 If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-go). |
13 If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-go). |
14 |
14 |
15 # Announcements |
15 # Announcements |
|
16 **The default branch name for this repository has been changed to `main` as of 07/27/2020.** |
16 |
17 |
17 All updates to this library is documented in our [CHANGELOG](https://github.com/sendgrid/rest/blob/master/CHANGELOG.md). |
18 All updates to this library is documented in our [CHANGELOG](CHANGELOG.md). |
18 |
19 |
19 # Table of Contents |
20 # Table of Contents |
20 - [Installation](#installation) |
21 - [Installation](#installation) |
21 - [Quick Start](#quick-start) |
22 - [Quick Start](#quick-start) |
22 - [Usage](#usage) |
23 - [Usage](#usage) |
23 - [Roadmap](#roadmap) |
|
24 - [How to Contribute](#contribute) |
24 - [How to Contribute](#contribute) |
25 - [About](#about) |
25 - [About](#about) |
26 - [License](#license) |
26 - [License](#license) |
27 |
27 |
28 <a name="installation"></a> |
28 <a name="installation"></a> |
53 ```bash |
53 ```bash |
54 echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env |
54 echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env |
55 echo "sendgrid.env" >> .gitignore |
55 echo "sendgrid.env" >> .gitignore |
56 source ./sendgrid.env |
56 source ./sendgrid.env |
57 ``` |
57 ``` |
|
58 |
|
59 ## With Docker |
|
60 |
|
61 A Docker image has been created to allow you to get started with `rest` right away. |
|
62 |
|
63 ```bash |
|
64 docker-compose up -d --build |
|
65 |
|
66 # Ensure the container is running with 'docker ps' |
|
67 docker ps |
|
68 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
69 40c8d984a620 rest_go "tail -f /dev/null" About a minute ago Up About a minute rest_go_1 |
|
70 ``` |
|
71 |
|
72 With the container running, you can execute your local `go` scripts using the following: |
|
73 |
|
74 ```bash |
|
75 # docker exec <container_name> <go command> |
|
76 docker exec rest_go_1 go run docker/example.go |
|
77 200 |
|
78 { |
|
79 "args": {}, |
|
80 "headers": { |
|
81 "Accept-Encoding": "gzip", |
|
82 "Connection": "close", |
|
83 "Host": "httpbin.org", |
|
84 "User-Agent": "Go-http-client/1.1" |
|
85 }, |
|
86 "origin": "86.180.177.202", |
|
87 "url": "https://httpbin.org/get" |
|
88 } |
|
89 |
|
90 map[Access-Control-Allow-Origin:[*] Access-Control-Allow-Credentials:[true] Via:[1.1 vegur] Connection:[keep-alive] Server:[gunicorn/19.9.0] Date:[Tue, 02 Oct 2018 18:20:43 GMT] Content-Type:[application/json] Content-Length:[233]] |
|
91 |
|
92 # You can install libraries too, using the same command |
|
93 # NOTE: Any libraries installed will be removed when the container is stopped. |
|
94 docker exec rest_go_1 go get github.com/uniplaces/carbon |
|
95 ``` |
|
96 |
|
97 Your go files will be executed relative to the root of this directory. So in the example above, to execute the `example.go` file within the `docker` directory, we run `docker exec rest_go_1 go run docker/example.go`. If this file was in the root of this repository (next to README.exe, rest.go etc.), you would run `docker exec rest_go_1 go run my_go_script.go` |
58 |
98 |
59 <a name="quick-start"></a> |
99 <a name="quick-start"></a> |
60 # Quick Start |
100 # Quick Start |
61 |
101 |
62 `GET /your/api/{param}/call` |
102 `GET /your/api/{param}/call` |
131 <a name="usage"></a> |
171 <a name="usage"></a> |
132 # Usage |
172 # Usage |
133 |
173 |
134 - [Usage Examples](USAGE.md) |
174 - [Usage Examples](USAGE.md) |
135 |
175 |
136 <a name="roadmap"></a> |
|
137 # Roadmap |
|
138 |
|
139 If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/rest/milestones). We would love to hear your feedback. |
|
140 |
|
141 <a name="contribute"></a> |
176 <a name="contribute"></a> |
142 # How to Contribute |
177 # How to Contribute |
143 |
178 |
144 We encourage contribution to our projects, please see our [CONTRIBUTING](https://github.com/sendgrid/rest/blob/master/CONTRIBUTING.md) guide for details. |
179 We encourage contribution to our projects, please see our [CONTRIBUTING](CONTRIBUTING.md) guide for details. |
145 |
180 |
146 Quick links: |
181 Quick links: |
147 |
182 |
148 - [Feature Request](https://github.com/sendgrid/rest/blob/master/CONTRIBUTING.md#feature-request) |
183 - [Feature Request](CONTRIBUTING.md#feature-request) |
149 - [Bug Reports](https://github.com/sendgrid/rest/blob/master/CONTRIBUTING.md#submit-a-bug-report) |
184 - [Bug Reports](CONTRIBUTING.md#submit-a-bug-report) |
150 - [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/rest/blob/master/CONTRIBUTING.md#cla) |
185 - [Improvements to the Codebase](CONTRIBUTING.md#improvements-to-the-codebase) |
151 - [Improvements to the Codebase](https://github.com/sendgrid/rest/blob/master/CONTRIBUTING.md#improvements-to-the-codebase) |
186 - [Code Reviews](CONTRIBUTING.md#code-reviews) |
152 |
187 |
153 <a name="about"></a> |
188 <a name="about"></a> |
154 # About |
189 # About |
155 |
190 |
156 rest is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). |
191 rest is maintained and funded by Twilio SendGrid, Inc. The names and logos for rest are trademarks of Twilio SendGrid, Inc. |
157 |
192 |
158 rest is maintained and funded by SendGrid, Inc. The names and logos for rest are trademarks of SendGrid, Inc. |
193 If you need help installing or using the library, please check the [Twilio SendGrid Support Help Center](https://support.sendgrid.com). |
|
194 |
|
195 If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! |
159 |
196 |
160 <a name="license"></a> |
197 <a name="license"></a> |
161 # License |
198 # License |
162 [The MIT License (MIT)](LICENSE.txt) |
199 [The MIT License (MIT)](LICENSE) |