Couchbase
Docs
Couchbase Documentation Overview
  • Server
  • N1QL
  • Full Text Search
  • Analytics (Developer Preview)
  • Eventing
  • Autonomous Operator
  • Mobile
  • Lite
  • Sync Gateway
  • SDKs
  • C
  • .NET
  • Go
  • Java
  • Node.js
  • PHP
  • Python
  • Connectors
  • Elasticsearch
  • Hadoop
  • Kafka
  • Spark
  • Talend
  • ODBC/JDBC
Couchbase Server 6.0 Beta
  • Couchbase Server 5.5
  • Couchbase Server 5.1
  • Couchbase Server 5.0
Downloads
  • Couchbase Server
  • REST API reference
  • REST API endpoint list
  • N1QL REST API
  • Examples
  • Edit

Examples

Here are some examples of the REST API:

  • Successful request

  • Request with positional parameters

  • Request with Named Parameters

  • Request Timeout

  • Request error

  • Service error

  • N1QL error

  • Unsupported HTTP method

  • Request with authentication - HTTP header

  • Request with authentication - request parameter

  • Welcome!
    • Why Couchbase?
    • What’s New?
    • Couchbase Server Editions
    • Contact Couchbase
  • Get Started
    • Start Here!
    • Do a Quick Install
    • Explore the Server Configuration
    • Run Your First N1QL Query
    • Choose Your Next Steps
  • Learn
    • Architecture Overview
      • Glossary
      • Architecture Diagrams
    • Data
      • Data Model
      • Extended Attributes
    • Buckets, Memory, and Storage
      • Buckets
        • vBuckets
        • Compression
        • Expiration
      • Memory and Storage
        • Memory
        • Storage
    • Services and Indexes
      • Services
        • Data Service
        • Query Service
        • Index Service
        • Search Service
        • Analytics Service
        • Eventing Service
      • Indexes
        • Global Secondary Indexes
          • Availability and Performance
          • Indexing
          • Scans
          • Pushdowns
          • Storage Settings
        • Views
          • View Concepts
            • Stream-based Views
            • View Operations
            • Views and Stored Data
            • Development Views
            • Production Views
          • MapReduce Views
            • Writing MapReduce Views
              • Views Best Practices
              • Map Function
              • Reduce Function
              • Built-in Utility Functions
              • Built-in _count Function
              • Built-in _sum Function
              • Built-in _stats Function
              • Re-writing Built-in Reduce Functions
              • Custom Reduce Functions
              • Re-reduce Argument
              • Views for Non-JSON Objects
              • Translating SQL to MapReduce
              • Views in a Schema-less Database
            • Querying MapReduce Views
              • View and Query Examples
          • Writing Spatial Views
            • Keys in Spatial View Functions
          • Querying Spatial Views
            • Open Range Queries
            • Closed Range Queries
            • Bounding Box Queries
          • Playing with GeoJSON Polygons
            • Creating a Spatial View Function
            • Querying All Data
            • Querying on the East
            • Querying on the Area
            • Querying on Non-intersect
          • Playing with Non-geographic Spatial Views
          • View Indexes for N1QL
    • Clusters and Availability
      • Cluster Manager
      • Connectivity
      • Size Limitations
      • Nodes
        • Failover
          • Graceful
          • Hard
          • Automatic
        • Rebalance
        • Recovery
      • Availability
        • Intra-Cluster Replication
        • Cross Data Center Replication (XDCR)
          • XDCR Advanced Settings
          • XDCR Conflict Resolution
          • XDCR Filtering
          • XDCR Cloud Deployment
        • Server Group Awareness
    • Security
      • Authentication
        • Usernames and Passwords
        • Certificates
      • Authorization
        • Roles
        • Resources Under Access Control
        • Upgrading to RBAC
      • Auditing
  • Manage
    • Management Overview
      • Management Tools
    • Manage Nodes and Clusters
      • Initialize a Node
      • Create a Cluster
      • Add a Node and Rebalance
      • Join a Cluster and Rebalance
      • List Cluster Nodes
      • Remove a Node and Rebalance
      • Fail a Node Over and Rebalance
        • Graceful
        • Hard
      • Recover a Node and Rebalance
    • Manage Buckets
      • Create a Bucket
      • Edit a Bucket
      • Flush a Bucket
      • Delete a Bucket
    • Manage Logging
    • Manage Settings
      • Cluster
      • Software Updates
      • Node Availability
      • Email Alerts
      • Auto Compaction
      • Sample Buckets
    • Manage Groups
    • Manage XDCR
      • Prepare for XDCR
      • Create a Reference
      • Create a Replication
      • Pause a Replication
      • Resume a Replication
      • Delete a Replication
      • Delete a Reference
      • Secure a Replication
        • Half-Secure
        • Fully Secure
      • Recover Data with XDCR
      • Monitor a Replication
    • Manage Security
      • Manage Security Settings
      • Manage Users and Roles
      • Manage Authentication
        • Configure saslauthd
        • Configure PAM
        • Manage Certificates
          • Configure Server Certificates
          • Configure Client Certificates
          • Enable Client-Certificate Handling
          • Rotate Server Certificates
          • Handle Certificate Errors
      • Manage Auditing
      • Manage Sessions
      • Manage Console Access
      • Manage System Secrets
      • Manage Connections and Disks
    • Manage Backup and Restore
      • Backup
        • backup-restore:cbbackupmgr-strategies.adoc
        • backup-restore:cbbackupmgr-tutorial.adoc
        • backup-restore:cbbackupmgr-archivelayout.adoc
      • Incremental Backup and Restore
    • Monitor
      • Manage Monitoring Options
      • Monitor with REST
      • Monitor with cbstats
      • Monitor Statistics
      • Monitor XDCR Timestamp-based Conflict Resolution
      • Monitor Queries
    • Troubleshoot
      • Common Errors
      • Core Files
  • Develop
    • Developer’s Intro
    • SDKs
      • c-sdk::start-using-sdk.adoc
      • dotnet-sdk::start-using-sdk.adoc
      • go-sdk::start-using-sdk.adoc
      • java-sdk::start-using-sdk.adoc
      • nodejs-sdk::start-using-sdk.adoc
      • php-sdk::start-using-sdk.adoc
      • python-sdk::start-using-sdk.adoc
    • Starter Kits
    • Query
      • N1QL Language Reference
      • N1QL Error Codes
      • N1QL Queries and Results
      • N1QL Application Continuity
      • Group By and Aggregate Performance
      • Query Settings
      • Getting System Information
      • Running N1QL Queries from a Command Line
      • Conventions
      • Reserved Words
      • Data Types
      • Literals
      • Identifiers
      • N1QL Auditing
      • Backfill Support for N1QL
      • Operators
        • Operators Overview
        • Arithmetic Operators
        • Collection Operators
        • Comparison Operators
        • Conditional Operators
        • Construction Operators
        • Logical Operators
        • Nested Operators and Expressions
        • String Operators
      • Functions
        • Functions Overview
        • Aggregate Functions
        • Array Functions
        • Bitwise Functions in N1QL
        • Comparison Functions
        • Conditional Functions for Unknowns
        • Conditional Functions for Numbers
        • Date Functions
        • JSON Functions
        • Miscellaneous Utility Functions
          • CURL Function
        • Number Functions
        • Object Functions
        • Pattern-matching Functions
        • String Functions
        • Token Functions
        • Type Functions
      • Subqueries
        • Correlated Subqueries
        • Examples
      • Boolean Logic
      • Statements
        • ALTER INDEX
        • BUILD INDEX
        • CREATE INDEX
          • Array Indexing
          • Covering Indexes
          • Adaptive Index
          • Indexing Metadata Information
          • Index Partitioning
        • CREATE PRIMARY INDEX
        • DELETE
        • DROP INDEX
        • DROP PRIMARY INDEX
        • EXECUTE
        • EXPLAIN
        • GRANT
        • INFER
        • INSERT
        • MERGE
        • PREPARE
        • REVOKE
        • SELECT
          • Overview
          • SELECT Syntax
          • SELECT Clause
          • FROM clause
          • USE INDEX clause
          • LET clause
          • WHERE clause
          • GROUP BY clause
          • UNION, INTERSECT, and EXCEPT
          • ORDER BY clause
          • LIMIT clause
          • OFFSET clause
        • UPDATE
        • UPSERT
    • Search
      • Performing Searches
        • Searching from the UI
        • Searching with the REST API
        • Demonstration Indexes
      • Creating Indexes
      • Understanding Analyzers
      • Understanding Queries
        • Query Types
          • Geospatial Queries
        • Sorting Query Results
        • Handling Response Objects
      • Troubleshooting and FAQs
    • Handle Events
      • Eventing Service Overview
      • Couchbase Functions
        • Language Constructs
        • Function Handler Code
          • Supported Operations
        • Functions CLI
        • Statistics
      • Functions Lifecycle Operations
        • Adding a Function
        • Deploying a Function
        • Undeploying a Function
        • Debugging a Function
        • Exporting and Importing of Functions
        • Deleting a Function
      • Adopting the Eventing Service in your Organization
      • Diagnostics and Debugging
      • Cluster Operations
      • Examples: Using the Eventing Service
        • Creating Buckets
        • Data Enrichment
        • Risk Assessment
        • Cascade Delete
        • Document Expiry and Archival
      • Troubleshooting and Best Practices
      • Frequently Asked Questions
  • Install & Upgrade
    • Couchbase Server Deployment Options
    • System Requirements
      • Supported Operating Systems
      • System Resource Requirements
      • Additional Requirements
      • Supported Web Browsers
      • Network and Firewall Requirements
        • Using IPv6 With Couchbase
    • Deployment Guidelines
      • Sizing Guidelines
        • Multidimensional Scaling (MDS)
      • Clock Sync with NTP
      • Disabling Transparent Huge Pages (THP)
      • Swap Space and Kernel Swappiness
      • Couchbase Client Deployment Strategies
      • Security Considerations
      • Deployment Considerations for Virtual Machines and Containers
      • About Deploying Clusters With Less Than Three Nodes
    • Installing the Couchbase Server Cluster
      • Installing on Linux
        • Red Hat and CentOS Installation
        • Ubuntu/Debian Installation
        • SUSE Enterprise Linux installation
        • Oracle Enterprise Linux installation
        • Installing Multiple Instances on Linux Platforms
      • Installing on Windows
      • Installing on Mac OS X
      • Verifying the Couchbase Server Installation
      • Initializing the Cluster
      • Couchbase Server Startup and Shutdown
      • Uninstalling Couchbase Server
    • Deploying Couchbase Server in Containers
      • Running Couchbase Server Using Docker
    • Deploying Couchbase in the Cloud
      • Amazon Web Services (AWS) and Couchbase
        • Deploying Couchbase from AWS Marketplace
        • Best Practices for Deploying Couchbase on AWS
      • Microsoft Azure and Couchbase
        • Deploying Couchbase from Azure Marketplace
        • Best Practices for Deploying Couchbase on Microsoft Azure
      • Google Cloud Platform and Couchbase
        • Deploying Couchbase on Google Cloud Launcher
        • Best Practices for Deploying Couchbase on Google Cloud Platform
    • Upgrading Couchbase Server
      • Upgrade Options
      • Performing the Rolling Online Upgrade
      • Performing the Offline Upgrade
      • Performing the Single Node Upgrade
      • Upgrading to Couchbase Server 6.0
    • Migrating
      • Enabling Timestamp-based Conflict Resolution for Migrated Data
      • Migrating from Apache CouchDB
      • Migrating from Relational Databases
  • Integrate
    • Connector Guides
    • Elasticsearch Plug-in
    • Hadoop Connector
    • Kafka Connector
    • Spark Connector
    • talend-connector::index.adoc
    • Couchbase ODBC and JDBC Drivers
  • Reference
    • CLI Reference
      • cbanalyze-core
      • cbbackup
        • Backing up with cbbackup
      • cbbackupwrapper and cbrestorewrapper
      • cbcollect_info
      • cbdocloader
      • cbepctl
        • set checkpoint_param
        • set flush_param
        • set tap_param
      • cbft-bleve-dump
      • cbft-bleve-query
      • cli:cbcli/cblogredaction.adoc
      • cbq
      • cbrecovery
      • cbrestore
        • Restoring with cbrestore
        • rehash=1
      • cbstats
        • all
        • allocator
        • checkpoint
        • config
        • dcp
        • dcpagg
        • dcp-vbtakeover
        • diskinfo
        • dispatcher
        • failovers
        • hash
        • items
        • key
        • kvstore
        • kvtimings
        • memory
        • prev-vbucket
        • raw
        • reset
        • responses
        • runtimes
        • scheduler
        • slabs
        • tap
        • tapagg
        • tap-vbtakeover
        • tasks
        • timings
        • uuid
        • vbucket
        • vbucket-details
        • vbucket-seqno
        • vkey
        • warmup
        • workload
      • cbtransfer
      • cbworkloadgen
      • mctimings
    • REST API reference
      • REST API endpoint list
        • Cluster API
          • Creating a new cluster
          • Retrieving Cluster Information
          • Viewing Cluster Details
          • Adding Nodes to Clusters
          • Joining Nodes into Clusters
          • Removing Nodes from Clusters
          • Rebalancing Nodes
          • Viewing Internal Settings
          • Managing Auto-Failover
            • Retrieving Auto-Failover Settings
            • Enabling and Disabling Auto-Failover
            • Resetting Auto-Failover
          • Disabling Consistent View Query Results on Rebalance
          • Setting Email Notifications
        • Server Nodes API
          • Getting Server Node Information
          • Enabling Couchbase Server Services
          • Failing over Nodes
          • Setting Recovery Type
          • Setting Graceful Failover
          • Setting Hostnames
          • Setting Usernames and Passwords
          • Setting Memory Quota
          • Setting Storage Paths
          • Retrieving Statistics
        • Server Groups API
          • Getting Server Group Information
          • Creating Server Groups
          • Adding Servers to Server Groups
          • Renaming Server Groups
          • Updating Server Group Memberships
          • Deleting Server Groups
        • Buckets API
          • Getting all Bucket Information
          • Getting Single Bucket Information
          • Getting Bucket Statistics
          • Getting Bucket Streaming URI
          • Creating and Editing Buckets
          • Setting Disk I/O Priority
          • Setting Metadata Ejection
          • Changing Bucket Parameters
          • Changing Bucket Authentication
          • Changing Bucket Memory Quota
          • Deleting Buckets
          • Flushing Buckets
        • Compaction API
          • Compacting Buckets
          • Compacting Spatial Views
          • Getting Auto-Compaction Settings
        • Index Service API
          • Retrieve GSI Settings
          • Set GSI Settings
          • Retrieve GSI Status
          • Retrieve a GSI Statement
        • N1QL REST API
          • Examples
            • Successful request
            • Request with positional parameters
            • Request with Named Parameters
            • Request Timeout
            • Request error
            • Service error
            • N1QL error
            • Unsupported HTTP method
            • Request with authentication - HTTP header
            • Request with authentication - request parameter
        • Full Text Search API
          • Node Configuration
          • Indexes
          • Advanced
        • Functions REST API
        • Views API
          • Getting Design Doc Information
          • Creating Design Documents
          • Deleting Design Documents
          • Getting Views Information
          • Limiting Views Requests
        • XDCR API
          • Creating XDCR Replications
          • Getting a Destination Cluster Reference
          • Setting Destination Cluster References
          • Deleting a Destination Cluster Reference
          • Managing XDCR Data Encryption
          • Deleting XDCR Replications
          • Managing Advanced XDCR Settings
          • Pausing XDCR Replication Streams
          • Getting XDCR Stats
        • Logs API
          • Retrieving Log Information
          • Creating Client Logs
        • Security API
          • Auditing API
          • Authorization API
            • Role Based Admin Access (RBAC)
            • Create a Read-Only Administrator
            • Retrieve the Read-Only Administrator’s Name
            • Change the Read-Only Administrator’s Password
            • Delete the Read-Only Administrator
          • Using REST for Encrypted Access
          • Encryption On-the-Wire API
          • Secret Management API
      • Admin API Explorer
    • Couchbase Server Tools
      • Query Tools
        • cbq: The Command Line Shell for N1QL
        • Query Workbench
        • Query Monitoring
      • Data Import/Export Tools
  • Release Notes & Licenses
    • Release Notes
    • Licenses for Third-Party Components
  • Contribute
    • Contribute to the Documentation
Couchbase

2440 West El Camino Real Mountain View, CA 94040 United States

Contact Us 1-650-417-7500
  • Company
  • About
  • Leadership
  • News & Press
  • Careers
  • Events
  • Contact Us
  • Pricing
  • Support
  • Developer Portal
  • Forums
  • Professional Services
  • Support Login
  • Training
  • Quicklinks
  • Blog
  • Downloads
  • Get Started
  • Online Training
  • Resources
  • Why NoSQL
  • Security
  • GDPR
2018 COUCHBASE All rights reserved. Privacy Policy Terms of Use Cookie Policy Marketing Preference Center