# Get big segment import

GET https://app.launchdarkly.com/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}

Returns information about a big segment import process. This is the import of a list-based segment that can include more than 15,000 entries.

Reference: https://launchdarkly.com/docs/api/segments/get-big-segment-import

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: LaunchDarkly REST API
  version: 1.0.0
paths:
  /api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}/imports/{importID}:
    get:
      operationId: get-big-segment-import
      summary: Get big segment import
      description: >-
        Returns information about a big segment import process. This is the
        import of a list-based segment that can include more than 15,000
        entries.
      tags:
        - subpackage_segments
      parameters:
        - name: projectKey
          in: path
          description: The project key
          required: true
          schema:
            type: string
            format: string
        - name: environmentKey
          in: path
          description: The environment key
          required: true
          schema:
            type: string
            format: string
        - name: segmentKey
          in: path
          description: The segment key
          required: true
          schema:
            type: string
            format: string
        - name: importID
          in: path
          description: The import ID
          required: true
          schema:
            type: string
            format: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Segment import response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Import'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestErrorRep'
        '404':
          description: Invalid resource identifier
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorRep'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitedErrorRep'
servers:
  - url: https://app.launchdarkly.com
  - url: https://app.launchdarkly.us
components:
  schemas:
    UnixMillis:
      type: integer
      format: int64
      title: UnixMillis
    ImportStatus:
      type: string
      enum:
        - preparing
        - pending_approval
        - ready
        - in_progress
        - complete
        - stopped
      description: The import status
      title: ImportStatus
    FileRep:
      type: object
      properties:
        filename:
          type: string
          description: The imported file name, including the extension
        status:
          type: string
          description: The imported file status
      title: FileRep
    Link:
      type: object
      properties:
        href:
          type: string
          description: The URL of the link
        type:
          type: string
          description: The type of the link
      title: Link
    Import:
      type: object
      properties:
        id:
          type: string
          description: The import ID
        segmentKey:
          type: string
          description: The segment key
        creationTime:
          $ref: '#/components/schemas/UnixMillis'
          description: Timestamp of when this import was created
        mode:
          type: string
          description: >-
            The import mode used, either <code>merge</code> or
            <code>replace</code>
        status:
          $ref: '#/components/schemas/ImportStatus'
          description: The import status
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileRep'
          description: The imported files and their status
        _links:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Link'
          description: The location and content type of related resources
      required:
        - id
        - segmentKey
        - creationTime
        - mode
        - status
        - _links
      title: Import
    InvalidRequestErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: InvalidRequestErrorRep
    NotFoundErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: NotFoundErrorRep
    RateLimitedErrorRep:
      type: object
      properties:
        code:
          type: string
          description: Specific error code encountered
        message:
          type: string
          description: Description of the error
      required:
        - code
        - message
      title: RateLimitedErrorRep
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization

```

## SDK Code Examples

```python
import requests

url = "https://app.launchdarkly.com/api/v2/segments/projectKey/environmentKey/segmentKey/imports/importID"

headers = {"Authorization": "<apiKey>"}

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

print(response.json())
```

```javascript
const url = 'https://app.launchdarkly.com/api/v2/segments/projectKey/environmentKey/segmentKey/imports/importID';
const options = {method: 'GET', headers: {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/segments/projectKey/environmentKey/segmentKey/imports/importID"

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

	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/segments/projectKey/environmentKey/segmentKey/imports/importID")

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

request = Net::HTTP::Get.new(url)
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/segments/projectKey/environmentKey/segmentKey/imports/importID")
  .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/segments/projectKey/environmentKey/segmentKey/imports/importID', [
  'headers' => [
    'Authorization' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://app.launchdarkly.com/api/v2/segments/projectKey/environmentKey/segmentKey/imports/importID");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/segments/projectKey/environmentKey/segmentKey/imports/importID")! 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()
```