# Poll Request Status

#### <mark style="color:green;">Poll Request Status (/api/v1/consent/transaction/status)</mark>&#x20;

### Request

This endpoint allows SP to fetch the status of the consent transaction triggered by the SP. This can be used as a fallback mechanism in case SP is not notified on the callback endpoint hosted by the SP.

| API URL                 | [https://stg-apis.uaepass.ae/api/v1/consent/transaction/status  ](https://stg-apis.uaepass.ae/api/v1/consent/transaction/status)                                                                                                                                                                                                                                                                                                                                                                                                      |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method                  | POST                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Source                  | Service Provider (Data Owner)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Target                  | UAEPASS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| SSL Enabled?            | YES                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Communication Mechanism | HTTPS                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Message Type            | JSON                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Security                | Client credential grant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Headers                 | <p>X-Timestamp: \[time this request was generated, used in HMAC token generation] </p><p>X-UAEPASS-Signature: Refer section <mark style="color:green;">API nonrepudiation – HMAC</mark> in <a href="api-security">Security</a></p><p>X-UP-AccessToken: refer section <mark style="color:green;">Generating client credential tokens</mark> in <a href="api-security">Security</a></p><p>Authorization: refer section <mark style="color:green;">Generating client credential tokens</mark> in <a href="api-security">Security</a></p> |

### Request Parameters

| Name            | Type   | Mandatory/Optional |
| --------------- | ------ | ------------------ |
| spTransactionID | String | M                  |
| spId            | String | M                  |

#### Sample Request

```
{ 

    "spTransactionID": "m9mhsb1iy0rqeru53e", 

    "spId": "owner_sp_client_id" 

} 
```

#### cURL Command

```
curl --location --request POST '/v1/consent/transaction/status' \
--header 'X-Timestamp: 1700000000' \
--header 'X-UAEPASS-Signature: {{X-UAEPASS-Signature}}' \
--header 'X-UP-AccessToken: {{abcde_ccg_access_token}}' \
--header 'Authorization: JWS {{abcde_ccg_jwt_token}}' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "spTransactionID": "XXX-12515",
    "spId": "abcde_client_id"
}'
```

### Response

#### Response Parameters

| Name                 | Type   | Mandatory/Optional | Description                                                                  |
| -------------------- | ------ | ------------------ | ---------------------------------------------------------------------------- |
| uaePassTransactionID | String | M                  | Generated uaepass id                                                         |
| spTransactionID      | String | M                  |                                                                              |
| status               | String | M                  | Expected Values: \[TRIGGERED – ACCEPTED – REJECTED – INIT\_FAILED – EXPIRED] |

#### Sample Success Response

```
{ 

    "code": "0", 

    "desc": { 

        "ar": "نجاح", 

        "en": "success" 

    }, 
    "data": { 

        "spTransactionID": "m9mhsb1iy0rqeru53e", 

        "uaePassTransactionID": "cb6b2f12-85d5-4b75-8607-7e47161af598", 

        "status": "ACCEPTED" 

    } 

} 
```

#### Error Response Codes

| Error Description                                     | Error Message                                                                                                                                                                                                                                                                       | Http Status Code |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| Missing headers: \[X-UAEPASS-Signature - X-Timestamp] | <p>{ </p><p>    "code": "401", </p><p>    "desc": { </p><p>        "ar": "UNAUTHORIZED", </p><p>        "en": "UNAUTHORIZED" </p><p>    } </p><p>} </p>                                                                                                                             | 401              |
| Invalid spId                                          | <p>{ </p><p>    "code": "CONS\_1000012", </p><p>    "desc": { </p><p>        "ar": "مقدم الخدمة \[owner\_sp\_client\_ids] غير موجودة.", </p><p>        "en": "Service Provider \[owner\_sp\_client\_ids] is not found." </p><p>    } </p><p>} </p>                                  | 404              |
| Invalid spTransactionID                               | <p>{ </p><p>    "code": "CONS\_1000010", </p><p>    "desc": { </p><p>        "ar": "المعاملة رقم \[thh95681-d24b-4b14-a5de-837b7e60c287-19] غير موجودة.", </p><p>        "en": "Transaction id \[thh95681-d24b-4b14-a5de-837b7e60c287-19] is not found." </p><p>    } </p><p>} </p> | 404              |
|                                                       |                                                                                                                                                                                                                                                                                     |                  |

#### <mark style="color:orange;">API Invocation Guidelines</mark>

The service provider (SP) should invoke this API only after the configured per-request expiry timeout has been reached. In most cases, the SP will receive the response earlier through the callback API, prior to the expiry time.

{% hint style="warning" icon="message-waveform" %}

* This API acts as a fallback mechanism when no response is received via the callback API.
* Avoid invoking the API before the expiry timeout to prevent unnecessary or duplicate requests.
  {% endhint %}
