Skip to content

Instantly share code, notes, and snippets.

@Garvice
Last active April 15, 2017 18:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Garvice/bb8c6f18394ad45bafc97acadb14c74b to your computer and use it in GitHub Desktop.
Save Garvice/bb8c6f18394ad45bafc97acadb14c74b to your computer and use it in GitHub Desktop.
const SMARTSHEET_URL: string = 'https://api.smartsheet.com/2.0'
const SHEET_ID: number = 123456789;
const API_TOKEN: string = 'Bearer ' + 'API Token';
getTodos(): Observable<Array<Todo>> {
let todos = this.http
.get(this.SMARTSHEET_URL + '/sheets/' + this.SHEET_ID, {headers: this.getHeaders()})
.map(extractTodos);
return todos;
}
private getHeaders() : Headers {
let headers = new Headers();
headers.append('Authorization', this.API_TOKEN );
headers.append('Content-type', 'application/json');
return headers;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment