# Get linked views for a given resource

GET https://app.launchdarkly.com/api/v2/projects/{projectKey}/view-associations/{resourceType}/{resourceKey}

Get a list of all linked views for a resource. Flags are identified by key. Segments are identified by segment ID.

Reference: https://launchdarkly.com/docs/api/views-beta/get-linked-views

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/projects/{projectKey}/view-associations/{resourceType}/{resourceKey}:
    get:
      operationId: get-linked-views
      summary: Get linked views for a given resource
      description: >-
        Get a list of all linked views for a resource. Flags are identified by
        key. Segments are identified by segment ID.
      tags:
        - subpackage_viewsBeta
      parameters:
        - name: projectKey
          in: path
          required: true
          schema:
            type: string
        - name: resourceType
          in: path
          required: true
          schema:
            $ref: >-
              #/components/schemas/ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersResourceType
        - name: resourceKey
          in: path
          required: true
          schema:
            type: string
        - name: environmentId
          in: query
          description: Environment ID. Required when resourceType is 'segments'
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: The number of views to return.
          required: false
          schema:
            type: integer
        - name: offset
          in: query
          description: >-
            Where to start in the list. Use this with pagination. For example,
            an offset of 10 skips the first ten items and then returns the next
            items in the list, up to the query `limit`.
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - name: LD-API-Version
          in: header
          description: Version of the endpoint.
          required: true
          schema:
            $ref: >-
              #/components/schemas/ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersLdApiVersion
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Views'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersResourceType:
      type: string
      enum:
        - flags
        - segments
      title: >-
        ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersResourceType
    ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersLdApiVersion:
      type: string
      enum:
        - beta
      title: >-
        ApiV2ProjectsProjectKeyViewAssociationsResourceTypeResourceKeyGetParametersLdApiVersion
    ViewsLink:
      type: object
      properties:
        href:
          type: string
        type:
          type: string
      title: ViewsLink
    ViewsPaginatedLinks:
      type: object
      properties:
        first:
          $ref: '#/components/schemas/ViewsLink'
        last:
          $ref: '#/components/schemas/ViewsLink'
        next:
          $ref: '#/components/schemas/ViewsLink'
        prev:
          $ref: '#/components/schemas/ViewsLink'
        self:
          $ref: '#/components/schemas/ViewsLink'
      required:
        - self
      title: ViewsPaginatedLinks
    ActionSpecifier:
      type: string
      title: ActionSpecifier
    ViewsAccessDeniedReasonEffect:
      type: string
      enum:
        - allow
        - deny
      description: Whether this statement should allow or deny actions on the resources.
      title: ViewsAccessDeniedReasonEffect
    ViewsAccessDeniedReason:
      type: object
      properties:
        resources:
          type: array
          items:
            type: string
          description: Resource specifier strings
        notResources:
          type: array
          items:
            type: string
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: Actions to perform on a resource
        notActions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
        effect:
          $ref: '#/components/schemas/ViewsAccessDeniedReasonEffect'
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
        role_name:
          type: string
      required:
        - effect
      title: ViewsAccessDeniedReason
    ViewsAccessDenied:
      type: object
      properties:
        action:
          type: string
        reason:
          $ref: '#/components/schemas/ViewsAccessDeniedReason'
      required:
        - action
        - reason
      title: ViewsAccessDenied
    ViewsAccessAllowedReasonEffect:
      type: string
      enum:
        - allow
        - deny
      description: Whether this statement should allow or deny actions on the resources.
      title: ViewsAccessAllowedReasonEffect
    ViewsAccessAllowedReason:
      type: object
      properties:
        resources:
          type: array
          items:
            type: string
          description: Resource specifier strings
        notResources:
          type: array
          items:
            type: string
          description: >-
            Targeted resources are the resources NOT in this list. The
            <code>resources</code> and <code>notActions</code> fields must be
            empty to use this field.
        actions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: Actions to perform on a resource
        notActions:
          type: array
          items:
            $ref: '#/components/schemas/ActionSpecifier'
          description: >-
            Targeted actions are the actions NOT in this list. The
            <code>actions</code> and <code>notResources</code> fields must be
            empty to use this field.
        effect:
          $ref: '#/components/schemas/ViewsAccessAllowedReasonEffect'
          description: >-
            Whether this statement should allow or deny actions on the
            resources.
        role_name:
          type: string
      required:
        - effect
      title: ViewsAccessAllowedReason
    ViewsAccessAllowedRep:
      type: object
      properties:
        action:
          type: string
        reason:
          $ref: '#/components/schemas/ViewsAccessAllowedReason'
      required:
        - action
        - reason
      title: ViewsAccessAllowedRep
    ViewsAccessRep:
      type: object
      properties:
        denied:
          type: array
          items:
            $ref: '#/components/schemas/ViewsAccessDenied'
        allowed:
          type: array
          items:
            $ref: '#/components/schemas/ViewsAccessAllowedRep'
      required:
        - denied
        - allowed
      title: ViewsAccessRep
    CoreLink:
      type: object
      properties:
        href:
          type: string
        type:
          type: string
      required:
        - href
        - type
      title: CoreLink
    ParentAndSelfLinks:
      type: object
      properties:
        self:
          $ref: '#/components/schemas/CoreLink'
        parent:
          $ref: '#/components/schemas/CoreLink'
      required:
        - self
        - parent
      description: The location and content type of related resources
      title: ParentAndSelfLinks
    ViewsMaintainerMember:
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        role:
          type: string
        firstName:
          type: string
        lastName:
          type: string
      required:
        - id
        - email
        - role
      title: ViewsMaintainerMember
    ViewsMaintainerTeam:
      type: object
      properties:
        id:
          type: string
        key:
          type: string
        name:
          type: string
      required:
        - id
        - key
        - name
      title: ViewsMaintainerTeam
    Maintainer:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
        maintainerMember:
          $ref: '#/components/schemas/ViewsMaintainerMember'
        maintainerTeam:
          $ref: '#/components/schemas/ViewsMaintainerTeam'
      required:
        - id
        - kind
      title: Maintainer
    ViewsSelfLink:
      type: object
      properties:
        self:
          $ref: '#/components/schemas/CoreLink'
      required:
        - self
      title: ViewsSelfLink
    ExpandedDirectlyLinkedFlag:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        links:
          $ref: '#/components/schemas/ViewsSelfLink'
      required:
        - key
        - name
        - links
      title: ExpandedDirectlyLinkedFlag
    ExpandedDirectlyLinkedFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedDirectlyLinkedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedDirectlyLinkedFlags
    FlagsSummary:
      type: object
      properties:
        count:
          type: integer
        linkedFlags:
          $ref: '#/components/schemas/ExpandedDirectlyLinkedFlags'
      required:
        - count
      title: FlagsSummary
    ExpandedDirectlyLinkedSegment:
      type: object
      properties:
        key:
          type: string
        name:
          type: string
        environmentId:
          type: string
        links:
          $ref: '#/components/schemas/ViewsSelfLink'
      required:
        - key
        - name
        - environmentId
        - links
      title: ExpandedDirectlyLinkedSegment
    ExpandedDirectlyLinkedSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedDirectlyLinkedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedDirectlyLinkedSegments
    SegmentsSummary:
      type: object
      properties:
        count:
          type: integer
        linkedSegments:
          $ref: '#/components/schemas/ExpandedDirectlyLinkedSegments'
      required:
        - count
      title: SegmentsSummary
    MetricsSummary:
      type: object
      properties:
        count:
          type: integer
      required:
        - count
      title: MetricsSummary
    AIConfigsSummary:
      type: object
      properties:
        count:
          type: integer
      required:
        - count
      title: AIConfigsSummary
    ResourceSummary:
      type: object
      properties:
        flagCount:
          type: integer
        segmentCount:
          type: integer
        totalCount:
          type: integer
      required:
        - flagCount
        - totalCount
      title: ResourceSummary
    ExpandedFlagMaintainerKind:
      type: string
      enum:
        - member
        - team
      description: The type of the maintainer
      title: ExpandedFlagMaintainerKind
    ViewsMemberSummary:
      type: object
      properties:
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ViewsLink'
          description: The location and content type of related resources
        _id:
          type: string
          description: The member's ID
        firstName:
          type: string
          description: The member's first name
        lastName:
          type: string
          description: The member's last name
        role:
          type: string
          description: >-
            The member's base role. If the member has no additional roles, this
            role will be in effect.
        email:
          type: string
          description: The member's email address
      required:
        - _links
        - _id
        - role
        - email
      title: ViewsMemberSummary
    ViewsMemberTeamSummaryRep:
      type: object
      properties:
        customRoleKeys:
          type: array
          items:
            type: string
          description: A list of keys of the custom roles this team has access to
        key:
          type: string
          description: The team key
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ViewsLink'
        name:
          type: string
          description: The team name
      required:
        - customRoleKeys
        - key
        - name
      title: ViewsMemberTeamSummaryRep
    ExpandedFlagMaintainer:
      type: object
      properties:
        key:
          type: string
          description: The ID of the maintainer member, or the key of the maintainer team
        kind:
          $ref: '#/components/schemas/ExpandedFlagMaintainerKind'
          description: The type of the maintainer
        _member:
          $ref: '#/components/schemas/ViewsMemberSummary'
        _team:
          $ref: '#/components/schemas/ViewsMemberTeamSummaryRep'
      required:
        - key
        - kind
      title: ExpandedFlagMaintainer
    ExpandedFlag:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the flag
        name:
          type: string
          description: A human-friendly name for the flag
        description:
          type: string
          description: Description of the flag
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        _version:
          type: integer
          description: Version of the flag
        archived:
          type: boolean
          description: Whether the flag is archived
        tags:
          type: array
          items:
            type: string
          description: Tags for the flag
        temporary:
          type: boolean
          description: Whether the flag is temporary
        includeInSnippet:
          type: boolean
          description: Whether to include in snippet
        maintainer:
          $ref: '#/components/schemas/ExpandedFlagMaintainer'
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      required:
        - key
        - name
      description: >-
        Flag representation for Views API - contains only fields actually used
        by the Views service
      title: ExpandedFlag
    ExpandedLinkedFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked flags for a view - requires passing the 'allFlags'
        expand field
      title: ExpandedLinkedFlags
    ExpandedSegment:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the segment
        name:
          type: string
          description: A human-friendly name for the segment
        environmentId:
          type: string
          description: Environment ID of the segment
        environmentKey:
          type: string
          description: Environment key of the segment
        description:
          type: string
          description: Description of the segment
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        lastModifiedDate:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        deleted:
          type: boolean
          description: Whether the segment is deleted
        tags:
          type: array
          items:
            type: string
          description: Tags for the segment
        unbounded:
          type: boolean
          description: Whether the segment is unbounded
        version:
          type: integer
          description: Version of the segment
        generation:
          type: integer
          description: Generation of the segment
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      required:
        - key
        - name
      description: >-
        Segment representation for Views API - contains only fields actually
        used by the Views service
      title: ExpandedSegment
    ExpandedLinkedSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked segments for a view - requires passing the
        'allSegments' expand field
      title: ExpandedLinkedSegments
    ExpandedMetric:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the metric
        name:
          type: string
          description: A human-friendly name for the metric
        creationDate:
          type: integer
          format: int64
          description: Creation date in milliseconds
        lastModified:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        isActive:
          type: boolean
          description: Whether the metric is active
        eventKey:
          type: string
          description: Event key for the metric
        _id:
          type: string
          description: ID of the metric
        _versionId:
          type: string
          description: Version ID of the metric
        kind:
          type: string
          description: Kind of the Metric
        category:
          type: string
          description: Category of the Metric
        description:
          type: string
          description: Description of the Metric
        isNumeric:
          type: boolean
        lastSeen:
          type: integer
          format: int64
          description: Last seen date in milliseconds
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      description: >-
        Metric representation for Views API - contains only fields actually used
        by the Views service
      title: ExpandedMetric
    ExpandedLinkedMetrics:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedMetric'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedMetrics
    ExpandedAIConfig:
      type: object
      properties:
        key:
          type: string
          description: A unique key used to reference the AI config
        name:
          type: string
          description: A human-friendly name for the AI config
        tags:
          type: array
          items:
            type: string
          description: Tags for the AI config
        description:
          type: string
          description: Description of the AI config
        version:
          type: integer
          description: Version of the AI config
        createdAt:
          type: integer
          format: int64
          description: Creation date in milliseconds
        updatedAt:
          type: integer
          format: int64
          description: Last modification date in milliseconds
        flagKey:
          type: string
          description: Key of the flag that this AI config is attached to
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
      description: >-
        AI Config representation for Views API - contains only fields actually
        used by the Views service
      title: ExpandedAIConfig
    ExpandedLinkedAIConfigs:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedAIConfig'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedAIConfigs
    ExpandedLinkedResourcesFlags:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedFlag'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedResourcesFlags
    ExpandedLinkedResourcesSegments:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ExpandedSegment'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: ExpandedLinkedResourcesSegments
    ExpandedLinkedResourcesItems:
      type: object
      properties:
        flags:
          $ref: '#/components/schemas/ExpandedLinkedResourcesFlags'
        segments:
          $ref: '#/components/schemas/ExpandedLinkedResourcesSegments'
      required:
        - flags
      title: ExpandedLinkedResourcesItems
    ExpandedLinkedResources:
      type: object
      properties:
        items:
          $ref: '#/components/schemas/ExpandedLinkedResourcesItems'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      description: >-
        Details on linked resources for a view - requires passing the
        'allResources' expand field
      title: ExpandedLinkedResources
    View:
      type: object
      properties:
        _access:
          $ref: '#/components/schemas/ViewsAccessRep'
        _links:
          $ref: '#/components/schemas/ParentAndSelfLinks'
        id:
          type: string
          format: string
          description: Unique ID of this view
        accountId:
          type: string
          description: ID of the account that owns this view
        projectId:
          type: string
          description: ID of the project this view belongs to
        projectKey:
          type: string
          description: Key of the project this view belongs to
        key:
          type: string
          description: Unique key for the view within the account/project
        name:
          type: string
          description: Human-readable name for the view
        description:
          type: string
          description: Optional detailed description of the view
        generateSdkKeys:
          type: boolean
          description: Whether to generate SDK keys for this view. Defaults to false.
        version:
          type: integer
          description: Version number for tracking changes
        tags:
          type: array
          items:
            type: string
          description: Tags associated with this view
        createdAt:
          type: integer
          format: int64
        updatedAt:
          type: integer
          format: int64
        archived:
          type: boolean
          default: false
          description: Whether this view is archived
        archivedAt:
          type: integer
          format: int64
        deletedAt:
          type: integer
          format: int64
        deleted:
          type: boolean
          default: false
          description: Whether this view is deleted
        maintainer:
          $ref: '#/components/schemas/Maintainer'
        flagsSummary:
          $ref: '#/components/schemas/FlagsSummary'
        segmentsSummary:
          $ref: '#/components/schemas/SegmentsSummary'
        metricsSummary:
          $ref: '#/components/schemas/MetricsSummary'
        aiConfigsSummary:
          $ref: '#/components/schemas/AIConfigsSummary'
        resourceSummary:
          $ref: '#/components/schemas/ResourceSummary'
        flagsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedFlags'
        segmentsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedSegments'
        metricsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedMetrics'
        aiConfigsExpanded:
          $ref: '#/components/schemas/ExpandedLinkedAIConfigs'
        resourcesExpanded:
          $ref: '#/components/schemas/ExpandedLinkedResources'
      required:
        - id
        - accountId
        - projectId
        - projectKey
        - key
        - name
        - description
        - generateSdkKeys
        - version
        - tags
        - createdAt
        - updatedAt
        - archived
        - deleted
      title: View
    Views:
      type: object
      properties:
        _links:
          $ref: '#/components/schemas/ViewsPaginatedLinks'
        items:
          type: array
          items:
            $ref: '#/components/schemas/View'
        totalCount:
          type: integer
      required:
        - items
        - totalCount
      title: Views
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
        - message
        - code
      title: Error
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag"

querystring = {"environmentId":"6890ff25c3e3830ba1a352e4"}

headers = {
    "LD-API-Version": "beta",
    "Authorization": "<apiKey>"
}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4';
const options = {method: 'GET', headers: {'LD-API-Version': 'beta', Authorization: '<apiKey>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("LD-API-Version", "beta")
	req.Header.Add("Authorization", "<apiKey>")

	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://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4")

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

request = Net::HTTP::Get.new(url)
request["LD-API-Version"] = 'beta'
request["Authorization"] = '<apiKey>'

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.get("https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4")
  .header("LD-API-Version", "beta")
  .header("Authorization", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4', [
  'headers' => [
    'Authorization' => '<apiKey>',
    'LD-API-Version' => 'beta',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4");
var request = new RestRequest(Method.GET);
request.AddHeader("LD-API-Version", "beta");
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "LD-API-Version": "beta",
  "Authorization": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/projects/default/view-associations/flags/my-flag?environmentId=6890ff25c3e3830ba1a352e4")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```