> For the complete documentation index, see [llms.txt](https://support.marscat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.marscat.io/development-guide/frontend-development/api-interface/api-interface-details/level-8/sendservicemessage.md).

# sendServiceMessage

Used to send Self Service messages through RelayX Network communication for various service calls and data transmission.

**Request Parameters**

| Parameter Name | Type   | Required | Description                                                  |
| -------------- | ------ | -------- | ------------------------------------------------------------ |
| type           | String | Yes      | Request protocol type, currently supports `HTTP`.            |
| content        | Object | Yes      | Specific request data structure defined by the request type. |

`content` data structure:

| Field   | Type   | Required | Description                                                        |
| ------- | ------ | -------- | ------------------------------------------------------------------ |
| method  | String | Yes      | HTTP method type, optional values: `POST`, `GET`, `PUT`, `DELETE`. |
| url     | String | Yes      | Request URL path.                                                  |
| headers | Object | No       | Request headers, JSON format key-value pairs.                      |
| data    | Object | No       | Data in the request body, JSON format.                             |

**Response Parameters**

| Parameter Name | Type   | Description                               |
| -------------- | ------ | ----------------------------------------- |
| result         | Object | Service returned response data structure. |

Call Example

{% code title="example.js" %}

```javascript
let payload = {
    type: "HTTP",
    content: {
      method: "POST",
      url: "/add",
      headers: {
        "Content-Type": "application/json"
      },
      data: {
        id: "1",
        name: "Alice"
      }
    }
};

let sign = {
  content: "xxxxxx",
  signature: "xxxxxx"
};

const response = await relayx.sendServiceMessage(payload, sign);
if (response.code == 200) {
  console.log("Cross-service result:", response.result);
}
```

{% endcode %}
