> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.me-mate.net/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.me-mate.net/_mcp/server.

# https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise

POST https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise
Content-Type: application/json

## Purpose

Fetch contacts filtered **tag-wise** for the authenticated account. This endpoint returns the list of contacts associated with one or more tag IDs.

## Endpoint

`POST https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise`

## Required variables

This request uses the following Postman variable(s):

* `{{api_key}}` (required): Your API key.

> Ensure `api_key` is defined in the active scope (environment/collection/global) before sending.

## Headers

* `X-Requested-With: XMLHttpRequest`

## Request body (JSON)

`Content-Type: application/json`

Fields:

* `api_key` *(string, required)*: API key value. In this collection it is typically set as `"{{api_key}}"`.

* `tags` *(array, required)*: List of tag IDs to filter by.

Example body:

```json
{
  "api_key": "{{api_key}}",
  "tags": [226, 227]
}

```

## Example request (placeholder)

```bash
curl --location 'https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise' \
  --header 'X-Requested-With: XMLHttpRequest' \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": "<YOUR_API_KEY>",
    "tags": [226, 227]
  }'

```

## Example success response (placeholder)

> Response shape can vary by account and tag configuration.

```json
{
  "success": true,
  "data": [
    {
      "contact_id": "<string|number>",
      "name": "<string>",
      "phone": "<string>",
      "email": "<string>",
      "tags": [226, 227]
    }
  ],
  "message": "<string>"
}

```

## Common error cases

* **400 Bad Request**

  * Missing required fields (`api_key`, `tags`)

  * `tags` is not an array or contains invalid IDs
* **401 Unauthorized / 403 Forbidden**

  * Invalid/expired API key (`api_key`)

  * API key not permitted to access the requested resource
* **422 Unprocessable Entity**

  * Validation errors for body fields (implementation dependent)
* **500 Internal Server Error**

  * Unexpected server-side failure

## Troubleshooting

* Confirm `{{api_key}}` resolves to a non-empty value (use the eye icon next to variables in Postman).

* Ensure `tags` contains numeric tag IDs that exist for the account.

* If you receive auth errors, re-check the active environment and the `api_key` variable value.

Reference: https://apidocs.me-mate.net/business-me-mate-net-ap-is-document-v-1-0/manage-contact/fetch-contacts-tag-wise/https-business-me-mate-net-api-betav-3-tagmanage-tag-fetch-contacts-tag-wise

## Request

### Headers

- `X-Requested-With` (string, optional)

### Body (application/json)

- `string`

## Response

### 200

OK

## Examples

**Request**

```json
"{\"api_key\": \"a1b2c3d4e5f67890abcdef1234567890\", \"tags\": [226, 227]}"
```

**Response**

```json
"{\n    \"status\": true,\n    \"msg\": \"Fetched contacts tag-wise\",\n    \"data\": [\n        {\n            \"id\": 23834,\n            \"user_id\": 43028,\n            \"contact_tag_id\": 110703,\n            \"tag_id\":"
```

**SDK Code**

```python
import requests

url = "https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise"

payload = "{\"api_key\": \"a1b2c3d4e5f67890abcdef1234567890\", \"tags\": [226, 227]}"
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '"{\"api_key\": \"a1b2c3d4e5f67890abcdef1234567890\", \"tags\": [226, 227]}"'
};

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

```go
package main

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

func main() {

	url := "https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise"

	payload := strings.NewReader("\"{\\\"api_key\\\": \\\"a1b2c3d4e5f67890abcdef1234567890\\\", \\\"tags\\\": [226, 227]}\"")

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

	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
require 'uri'
require 'net/http'

url = URI("https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "\"{\\\"api_key\\\": \\\"a1b2c3d4e5f67890abcdef1234567890\\\", \\\"tags\\\": [226, 227]}\""

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

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

HttpResponse<String> response = Unirest.post("https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise")
  .header("Content-Type", "application/json")
  .body("\"{\\\"api_key\\\": \\\"a1b2c3d4e5f67890abcdef1234567890\\\", \\\"tags\\\": [226, 227]}\"")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise', [
  'body' => '"{\\"api_key\\": \\"a1b2c3d4e5f67890abcdef1234567890\\", \\"tags\\": [226, 227]}"',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "\"{\\\"api_key\\\": \\\"a1b2c3d4e5f67890abcdef1234567890\\\", \\\"tags\\\": [226, 227]}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = "{\"api_key\": \"a1b2c3d4e5f67890abcdef1234567890\", \"tags\": [226, 227]}" as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://business.me-mate.net/api/betav3/tagmanage/tag/fetchContactsTagWise")! 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()
```