{"_id":"563a2dbd1846790d0089531a","category":{"_id":"563a2dbb1846790d0089530b","project":"54d4ecb5f6c48a0d00f0f041","pages":["563a2dbd1846790d00895318","563a2dbd1846790d00895319","563a2dbd1846790d0089531a","563a2dbd1846790d0089531b","563a2dbd1846790d0089531c","563a2dbd1846790d0089531d","563a2dbd1846790d0089531e"],"version":"563a2dba1846790d00895309","__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-06T16:37:55.318Z","from_sync":false,"order":3,"slug":"endpoints","title":"API Endpoints"},"project":"54d4ecb5f6c48a0d00f0f041","user":"54d4ec36f6c48a0d00f0f040","editedParams2":true,"version":{"_id":"563a2dba1846790d00895309","__v":3,"project":"54d4ecb5f6c48a0d00f0f041","createdAt":"2015-11-04T16:09:30.844Z","releaseDate":"2015-11-04T16:09:30.844Z","categories":["563a2dbb1846790d0089530a","563a2dbb1846790d0089530b","563a2dbb1846790d0089530c","56620e60f183880d004d3217","5702e5b8f2d6f336005e9025"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"No Mashape","version_clean":"1.1.0","version":"1.1"},"__v":1,"editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-07T00:57:35.372Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"OK","code":"{\n  \"meta\": {\n    \":::at:::self\": {\n      \"href\": \"https://api.instacount.io/sharded_counters/num-followers-abc\"\n    },\n    \"@increment\": {\n      \"href\": \"https://api.instacount.io/sharded_counters/num-followers-abc/increments\"\n    },\n    \"@decrement\": {\n      \"href\": \"https://api.instacount.io/sharded_counters/num-followers-abc/decrements\"\n    }\n  },\n  \"name\": \"num-followers-abc\",\n  \"description\": \"The number of followers for user abc\",\n  \"numShards\": 3,\n  \"status\": \"AVAILABLE\",\n  \"count\": 13,\n  \"created\": \"2015-08-24T22:45:13.985Z\"\n}","language":"json","status":200},{"language":"json","code":"{\n  \"errors\": [\n    {\n      \"message\": \"You must be signed-in to access the information you requested.\",\n      \"developerMessage\": \"You must enable proper Instacount Authentication!  Invalid X-Instacount-API-Key Header!\",\n      \"moreInfo\": \"https://instacount.readme.io\"\n    }\n  ]\n}","status":401},{"code":"{\n  \"errors\": [\n    {\n      \"message\": \"What you requested does not exist.\",\n      \"developerMessage\": \"The resource you requests was not found!\",\n      \"moreInfo\": \"https://instacount.readme.io\"\n    }\n  ]\n}","language":"json","status":404}]},"settings":"","examples":{"codes":[{"code":"{\n  \"name\": \"num-followers-abc\",\n  \"description\": \"The number of followers for user 'abc'\",\n  \"status\": \"AVAILABLE\"\n}","name":"Example Update Payload","language":"json"}]},"method":"put","auth":"required","params":[{"_id":"55231031dbe3622300a324b6","ref":"","in":"path","required":true,"desc":"A unique name that identifies the counter.","default":"num-followers-abc","type":"string","name":"name"},{"_id":"564fbbb366438d0d0026ee19","ref":"","in":"body","required":true,"desc":"The description of the counter. This value is limited to 500 characters, and may contain any UTF-16 Unicode characters.","default":"The number of beans I have","type":"string","name":"description"},{"_id":"564fbbb366438d0d0026ee18","ref":"","in":"body","required":true,"desc":"The status of the counter. Can be either 'AVAILABLE' or 'READ_ONLY_COUNT'.","default":"AVAILABLE","type":"string","name":"status"}],"url":"/sharded_counters/:name"},"isReference":false,"order":2,"body":"Most of the fields of a counter can be updated by clients, with a few restrictions:\n\n* **name:** The counter name can only be set upon counter creation.  Once set, it can not be changed.\n* **description:** The counter's description can be changed as long as the counter has the **AVAILABLE** status.\n* **status:** The current status of the counter.  If a counter has a status of **AVAILABLE**, then is can be updated to have a status of **READ_ONLY**.  Conversely, a counter with the READ_ONLY status may be updated to have the AVAILABLE status.  A counter with any other status mat not be mutated.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Updating Counter Counts\",\n  \"body\": \"Instacount utilizes a sharding mechanism to provide high-throughput counter operations.  As such, mutating the count of a counter is not permitted via this endpoint.  Instead, utilze the /increment and /decrement resources to create counter operations that, when applied, will adjust a counter's count.\"\n}\n[/block]","excerpt":"Update an existing counter","slug":"update-a-counter","type":"endpoint","title":"Update a Counter"}

putUpdate a Counter

Update an existing counter

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

name:
required
stringnum-followers-abc
A unique name that identifies the counter.

Body Params

description:
required
stringThe number of beans I have
The description of the counter. This value is limited to 500 characters, and may contain any UTF-16 Unicode characters.
status:
required
stringAVAILABLE
The status of the counter. Can be either 'AVAILABLE' or 'READ_ONLY_COUNT'.

Examples


Result Format


Documentation

Most of the fields of a counter can be updated by clients, with a few restrictions: * **name:** The counter name can only be set upon counter creation. Once set, it can not be changed. * **description:** The counter's description can be changed as long as the counter has the **AVAILABLE** status. * **status:** The current status of the counter. If a counter has a status of **AVAILABLE**, then is can be updated to have a status of **READ_ONLY**. Conversely, a counter with the READ_ONLY status may be updated to have the AVAILABLE status. A counter with any other status mat not be mutated. [block:callout] { "type": "danger", "title": "Updating Counter Counts", "body": "Instacount utilizes a sharding mechanism to provide high-throughput counter operations. As such, mutating the count of a counter is not permitted via this endpoint. Instead, utilze the /increment and /decrement resources to create counter operations that, when applied, will adjust a counter's count." } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}