---
schema_version: "1"
id: 1c227f66b14feb117f634c6dbeb7596632afc95e06acb3d25b210110f20942d8
title: Test Credentials in the Target Org
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/security/named-credentials/guides/nc-test-credentials.md
canonical_url: https://developer.salesforce.com/docs/platform/named-credentials/guide/nc-test-credentials.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a378de056d1291f5130f8565bc0539e3bfba5c0f741ff9891caaabb6a835472d
products:
  - Named Credentials
  - Security
---
# Test Credentials in the Target Org

Now that external credential access tokens are populated, use the named credential in a callout in your sandbox or testing org to verify that it works as expected.

**warning:** Be careful not to test credentials in your production environment.

In this Apex code, a named credential and an appended path specify the callout’s endpoint. The referenced named credential specifies the endpoint URL, and the external credential connected to the named credential specifies authentication settings.

```apex
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:My_Named_Credential/some_path');
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug(res.getBody());
```
