---
title: newrelic_accept_distributed_trace_payload_httpsafe (PHP agent API)
source: https://docs.newrelic.com/docs/apm/agents/php-agent/php-agent-api/newrelicacceptdistributedtracepayloadhttpsafe-php-agent-api
---

## Syntax

```php
newrelic_accept_distributed_trace_payload_httpsafe(string $httpsafe_payload, string $transport_type)
```

Accepts a distributed trace payload that includes an HTTPSafe (Base64 encoded) JSON string.

## Requirements

Requires PHP agent [version 8.4 or higher](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes).

## Description

[Distributed tracing](https://docs.newrelic.com/docs/agents/php-agent/features/distributed-tracing-php) allows you to see the path that a request takes as it travels through a distributed system. This is useful, for example, when individual transactions occur in multiple services, and you want to examine them as a complete transaction trace.

> #### ⚠️ IMPORTANT
>
> With PHP agent [version 9.10 or](https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes) higher, the following JSON functions are now considered deprecated and will be removed in a future release:
>
> ```php
> newrelic_create_distributed_trace_payload()
> newrelic_accept_distributed_trace_payload($payload)
> newrelic_accept_distributed_trace_payload_httpsafe($payload)
> ```
>
> Instead, use the API that is compatible with W3C Trace Context support, added in agent version 9.8. With this, the API for manually instrumenting applications has changed from the JSON payload related functions to the following header array forms:
>
> ```php
> newrelic_insert_distributed_trace_headers($outbound_headers)
> newrelic_accept_distributed_trace_headers($inbound_headers)
> ```

## Parameters

| Parameter                    | Description                                                                                                                                                                                                                                 |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `$httpsafe_payload` _string_ | Required. An HTTPSafe (Base64 encoded) JSON string representation of the payload.                                                                                                                                                           |
| `$transport_type` _string_   | Optional. A string overriding the default transport type. Default values: - `HTTP` for web traffic - `Unknown` for non-web traffic Additional accepted values: - `AMQP` - `HTTP` - `HTTPS` - `IronMQ` - `JMS` - `Kafka` - `Other` - `Queue` |

## Return values

Returns `true` to indicate success, or `false` if an error occurs.

## Examples

For examples of how and when to use this API method, see the documentation to [manually instrument applications and services](https://docs.newrelic.com/docs/agents/php-agent/features/distributed-tracing-php#manual).
