For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://developer.shipbob.com/experimental/api/channels/llms.txt. For full documentation content, see https://developer.shipbob.com/experimental/api/channels/llms-full.txt.

#   Search channels


POST https://api.shipbob.com/Experimental/channel:search
Content-Type: application/json

  Search channels based on filters


Reference: https://developer.shipbob.com/experimental/api/channels/search-channels

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: api-experimental
  version: 1.0.0
paths:
  /Experimental/channel:search:
    post:
      operationId: search-channels
      summary: |2
          Search channels
      description: |2
          Search channels based on filters
      tags:
        - subpackage_channels
      parameters:
        - name: Authorization
          in: header
          description: Authentication using Personal Access Token (PAT) token
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Channels.v2.ChannelSearchViewModel'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Channels.Post.Api.V2.Channel.Search.Bad.Request.Object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Channels.v2.ChannelsV2SearchRequest'
servers:
  - url: https://api.shipbob.com
  - url: https://sandbox-api.shipbob.com
components:
  schemas:
    Channels.v2.SearchFilters:
      type: object
      properties:
        channel_ids:
          type:
            - array
            - 'null'
          items:
            type: integer
          description: Channel Ids to search for
        channel_names:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Channel Names to search for
      description: Search filters
      title: Channels.v2.SearchFilters
    Channels.v2.ChannelsV2SearchRequest:
      type: object
      properties:
        cursor:
          type:
            - string
            - 'null'
          description: Next/Previous Cursor
        records_per_page:
          type: integer
          description: Records Per Page
        search_filters:
          $ref: '#/components/schemas/Channels.v2.SearchFilters'
      description: Channel search request body
      title: Channels.v2.ChannelsV2SearchRequest
    Channels.v2.ChannelBasicViewModel:
      type: object
      properties:
        id:
          type: integer
        name:
          type:
            - string
            - 'null'
      description: Channel basic information
      title: Channels.v2.ChannelBasicViewModel
    Channels.v2.ChannelSearchViewModel:
      type: object
      properties:
        items:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Channels.v2.ChannelBasicViewModel'
          description: List of channels
        next:
          type:
            - string
            - 'null'
          description: Next page cursor
        prev:
          type:
            - string
            - 'null'
          description: Previous page cursor
        total_records:
          type: integer
          description: Total records on current page
      description: GChannel search response
      title: Channels.v2.ChannelSearchViewModel
    Channels.Post.Api.V2.Channel.Search.Bad.Request.Object:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      title: Channels.Post.Api.V2.Channel.Search.Bad.Request.Object
  securitySchemes:
    PAT:
      type: http
      scheme: bearer
      description: Authentication using Personal Access Token (PAT) token
    OAuth2:
      type: http
      scheme: bearer
      description: OAuth2 authentication using JWT tokens

```

## SDK Code Examples

```python Channels_searchChannels_example
import requests

url = "https://api.shipbob.com/Experimental/channel:search"

payload = {
    "cursor": "string",
    "records_per_page": 0,
    "search_filters": {
        "channel_ids": [0],
        "channel_names": ["string"]
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Channels_searchChannels_example
const url = 'https://api.shipbob.com/Experimental/channel:search';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"cursor":"string","records_per_page":0,"search_filters":{"channel_ids":[0],"channel_names":["string"]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Channels_searchChannels_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.shipbob.com/Experimental/channel:search"

	payload := strings.NewReader("{\n  \"cursor\": \"string\",\n  \"records_per_page\": 0,\n  \"search_filters\": {\n    \"channel_ids\": [\n      0\n    ],\n    \"channel_names\": [\n      \"string\"\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Channels_searchChannels_example
require 'uri'
require 'net/http'

url = URI("https://api.shipbob.com/Experimental/channel:search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"cursor\": \"string\",\n  \"records_per_page\": 0,\n  \"search_filters\": {\n    \"channel_ids\": [\n      0\n    ],\n    \"channel_names\": [\n      \"string\"\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Channels_searchChannels_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.shipbob.com/Experimental/channel:search")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cursor\": \"string\",\n  \"records_per_page\": 0,\n  \"search_filters\": {\n    \"channel_ids\": [\n      0\n    ],\n    \"channel_names\": [\n      \"string\"\n    ]\n  }\n}")
  .asString();
```

```php Channels_searchChannels_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.shipbob.com/Experimental/channel:search', [
  'body' => '{
  "cursor": "string",
  "records_per_page": 0,
  "search_filters": {
    "channel_ids": [
      0
    ],
    "channel_names": [
      "string"
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Channels_searchChannels_example
using RestSharp;

var client = new RestClient("https://api.shipbob.com/Experimental/channel:search");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"cursor\": \"string\",\n  \"records_per_page\": 0,\n  \"search_filters\": {\n    \"channel_ids\": [\n      0\n    ],\n    \"channel_names\": [\n      \"string\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Channels_searchChannels_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "cursor": "string",
  "records_per_page": 0,
  "search_filters": [
    "channel_ids": [0],
    "channel_names": ["string"]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/Experimental/channel:search")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```