---
title: Get Scope
slug: api-marketplace/get-scope
createdAt: 2023-11-02T11:46:52.780Z
---

## Introduction

Get Scope API is specifically tailored to accept a request ID, which is generated by our **Create URL** API. Upon receiving this request ID, the API retrieves a list of files to which your end customers have granted their consent to access.

***

## API details

### Endpoint

:::CodeblockTabs
Production environment

```jsx
POST https://api.signzy.app/api/v3/digilocker/getScope
```

Production 2.0 environment

```none
https://api.signzy.app/api/v3/digilocker-v2/getScope
```
:::

:::CodeblockTabs
UAT/Testing environment

```jsx
POST https://api-preproduction.signzy.app/api/v3/digilocker/getScope
```

UAT/Testing 2.0 environment

```none
POST https://api-preproduction.signzy.app/api/v3/digilocker-v2/getScope
```
:::

***

### Request headers&#x20;

| Name          | Value            | Required  | Description                                                                                                |
| ------------- | ---------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| Content-Type  | application/json | Mandatory | The type of content that the request body contains.                                                        |
| Authorization | XXXXXXXXXXXXXXX  | Mandatory | An authentication token to authorize the request. Reach out to the Signzy support team to get one created. |

***

### Request body parameters

| **Parameter** | **Data Type** | **Description**                                                                                                                 | **Required** |
| ------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| requestId     | String        | Unique ID allocated after the authorization in digilocker iframe.<br />This is returned as **requestId** in **Create URL** API. | Mandatory    |

```json
{
    "requestId": "65797035c4f51c00108aec41"
}
```

***

### Code samples

:::CodeblockTabs
```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/digilocker/getScope' \
--header 'Authorization: <Your access token>' \
--header 'Content-Type: application/json' \
--data '{
    "requestId": "65797035c4f51c00108aec41"
}'
```

```nodejs
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api-preproduction.signzy.app/api/v3/digilocker/getScope',
  'headers': {
    'Authorization': '<Your access token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "requestId": "65797035c4f51c00108aec41"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

```

```python
import requests
import json

url = "https://api-preproduction.signzy.app/api/v3/digilocker/getScope"

payload = json.dumps({
  "requestId": "65797035c4f51c00108aec41"
})
headers = {
  'Authorization': '<Your access token>',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

```

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api-preproduction.signzy.app/api/v3/digilocker/getScope"
  method := "POST"

  payload := strings.NewReader(`{
    "requestId": "65797035c4f51c00108aec41"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "<Your access token>")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```
:::

***

### Response body parameters

| **Parameter** | **Data Type**    | **Description**                                                               |
| ------------- | ---------------- | ----------------------------------------------------------------------------- |
| result        | Object           | Contains the result of the task being performed.                              |
| result.scope  | Array of Strings | Contains the list of files/data for which the end customer has given consent. |

:::CodeblockTabs
200

```json
{
    "result": {
        "scope": [
            "files.issueddocs",
            "issued/in.gov.uidai-ADHAR-XXXXXXXXXX",
            "issued/in.gov.pan-PANCR-XXXXX0000X",
            "userdetails",
            "email",
            "picture"
        ]
    }
}
```

400

```json
// If the customer denies consent for accessing data on the digilocker screen
{
    "error": {
        "statusCode": 400,
        "name": "error",
        "message": "User denied the consent, please try again",
        "status": 400
    }
}

// If the customer clicks on “Return to Signzy” anytime during the digilocker journey
{
    "error": {
        "statusCode": 400,
        "name": "error",
        "message": "User cancelled the journey, please try again",
        "status": 400
    }
}

// If the request ID is invalid
{
    "error": {
        "reason": "BAD_REQUEST",
        "status": 400,
        "message": "INVALID reqId",
        "type": "Bad Request",
        "statusCode": 400,
        "name": "error"
    }
}
```

401

```json
// If Authorization token is not passed
{
    "message": "No API key found in request"
}

// If Authorization token is invalid
{
    "message": "Invalid authentication credentials"
}

// You are trying to fetch details of other person
{
    "error": {
        "reason": "AUTHORIZATION_FAILED",
        "status": 401,
        "message": "User is not Authorized to fetch details of 652523835a9f9000112b1ee6",
        "type": "Unauthorized",
        "statusCode": 401,
        "name": "error"
    }
}
```

404

```json
{
    "error": {
        "reason": "NOT_FOUND",
        "status": 404,
        "message": "RequestID not Found",
        "type": "Not Found",
        "statusCode": 404,
        "name": "error"
    }
}
```
:::

***

**Contact Us for Any Assistance**

If you have any questions or need assistance, please reach out to our customer support team. You can contact us via email at <font color="#2166ae">**help\@signzy.com**</font>. We strive to provide prompt and reliable assistance, ensuring your queries are addressed effectively.

We value your feedback and are committed to making your experience smooth and enjoyable. Our team is dedicated to assisting you with any needs you may have. Thank you for choosing our services. We look forward to helping you!

