{"_id":"550ada9e921b7d0d0022887e","category":{"_id":"55246f72ccc28a0d0062c560","version":"550ada9d921b7d0d00228876","__v":1,"pages":["55356d8ee3f0920d004f5c54"],"project":"550a379f635c660d00527fd8","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-07T23:59:46.143Z","from_sync":false,"order":3,"slug":"general-usage","title":"General Usage"},"version":{"_id":"550ada9d921b7d0d00228876","forked_from":"550a3b2542fff40d00ae5ffb","project":"550a379f635c660d00527fd8","__v":3,"createdAt":"2015-03-19T14:18:05.245Z","releaseDate":"2015-03-19T14:18:05.245Z","categories":["550ada9d921b7d0d00228877","550ada9d921b7d0d00228878","550ada9d921b7d0d00228879","550ada9d921b7d0d0022887a","550ada9d921b7d0d0022887b","550ada9d921b7d0d0022887c","550ada9d921b7d0d0022887d","5523e61e71c0542100993493","55246f72ccc28a0d0062c560"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0.0"},"project":"550a379f635c660d00527fd8","user":"550a378e635c660d00527fd7","__v":14,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-19T03:06:00.462Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"This page assumes that the reader understands how to make a basic call using the library (See [Making a call](doc:making-a-call)).\"\n}\n[/block]\nCall context options are passed in as a second object to any call and change how that specific call behaves.\n\nFor example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// bypass authentication for this call\\nvar callContextOptions = { bypassAuth: true };\\nreddit('/hot').get({ limit: 100 }, callContextOptions).then(/**/);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nCall context options will *always* override values set in the global [Configuration Options](doc:configuration-options). For example, it is possible to set `decodeHtmlEntities` globally in the configuration options (`new Snoocore(/* config here */)`) but that value can be overridden in the call's context options.\n\n## Possible context options\n\n - [Bypass authentication](#bypass-authentication)\n - [Listing Index](#listing-index)\n - [Decode HTML entities](#decode-html-entities)\n - [Retry attempts](#retry-attempts)\n - [Retry delay](#retry-delay)\n - [Request timeout](#request-timeout)\n\n### Bypass Authentication\n\n`bypassAuth: <boolean>`\n\nIt may be useful to bypass authentication for a call to get a resource as it is when not authenticated. This option will perform the call as if the user was unauthenticated.\n\n### Listing Index\n\nAn integer that specifies which listing to use when an endpoint returns multiple listings. Required when a listing endpoint returns multiple listings.\n\n### Decode HTML Entities\n\nCall context version of the global setting `decodeHtmlEntities` (See [Configuration Options](doc:configuration-options)).\n\n### Retry Attempts\n\nCall context version of the global setting `retryAttempts` (See [Configuration Options](doc:configuration-options)).\n\n### Retry Delay\n\nCall context version of the global setting `retryDelay` (See [Configuration Options](doc:configuration-options)).\n\n### Request timeout\n\nCall context version of the global setting `requestTimeout` (See [Configuration Options](doc:configuration-options)).","excerpt":"","slug":"call-context-options","type":"basic","title":"Call Context Options"}

Call Context Options


[block:callout] { "type": "info", "title": "Note", "body": "This page assumes that the reader understands how to make a basic call using the library (See [Making a call](doc:making-a-call))." } [/block] Call context options are passed in as a second object to any call and change how that specific call behaves. For example: [block:code] { "codes": [ { "code": "// bypass authentication for this call\nvar callContextOptions = { bypassAuth: true };\nreddit('/hot').get({ limit: 100 }, callContextOptions).then(/**/);", "language": "javascript" } ] } [/block] Call context options will *always* override values set in the global [Configuration Options](doc:configuration-options). For example, it is possible to set `decodeHtmlEntities` globally in the configuration options (`new Snoocore(/* config here */)`) but that value can be overridden in the call's context options. ## Possible context options - [Bypass authentication](#bypass-authentication) - [Listing Index](#listing-index) - [Decode HTML entities](#decode-html-entities) - [Retry attempts](#retry-attempts) - [Retry delay](#retry-delay) - [Request timeout](#request-timeout) ### Bypass Authentication `bypassAuth: <boolean>` It may be useful to bypass authentication for a call to get a resource as it is when not authenticated. This option will perform the call as if the user was unauthenticated. ### Listing Index An integer that specifies which listing to use when an endpoint returns multiple listings. Required when a listing endpoint returns multiple listings. ### Decode HTML Entities Call context version of the global setting `decodeHtmlEntities` (See [Configuration Options](doc:configuration-options)). ### Retry Attempts Call context version of the global setting `retryAttempts` (See [Configuration Options](doc:configuration-options)). ### Retry Delay Call context version of the global setting `retryDelay` (See [Configuration Options](doc:configuration-options)). ### Request timeout Call context version of the global setting `requestTimeout` (See [Configuration Options](doc:configuration-options)).