# 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.1 info: title: |2 Search channels version: endpoint_channels.searchChannels 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: {} '401': description: Unauthorized content: {} '403': description: Forbidden content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/Channels.v2.ChannelsV2SearchRequest' 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 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' Channels.v2.ChannelBasicViewModel: type: object properties: id: type: integer name: type: - string - 'null' 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 ``` ## 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 ", "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 ', '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 ") 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 ' 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 response = Unirest.post("https://api.shipbob.com/Experimental/channel:search") .header("Authorization", "Bearer ") .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 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 ', '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 "); 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 ", "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() ```