From 3403f5b778d685981ef9961ec7866c3ff6910749 Mon Sep 17 00:00:00 2001 From: ChakshuGautam Date: Sun, 25 Jun 2023 09:22:49 +0530 Subject: [PATCH 1/2] Setup Scaffold for Digilocker Wrapper --- package-lock.json | 8 + package.json | 5 +- .../digilocker/schema/authpartner.schema.d.ts | 2219 +++++++++++ src/impl/digilocker/schema/issuer.schema.d.ts | 263 ++ src/impl/digilocker/spec/authpartner.yaml | 3260 +++++++++++++++++ src/impl/digilocker/spec/issuer.yaml | 426 +++ src/impl/digilocker/wrapper/index.ts | 9 + 7 files changed, 6189 insertions(+), 1 deletion(-) create mode 100644 src/impl/digilocker/schema/authpartner.schema.d.ts create mode 100644 src/impl/digilocker/schema/issuer.schema.d.ts create mode 100644 src/impl/digilocker/spec/authpartner.yaml create mode 100644 src/impl/digilocker/spec/issuer.yaml create mode 100644 src/impl/digilocker/wrapper/index.ts diff --git a/package-lock.json b/package-lock.json index d295cdf..18954b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "digilocker-sdk", "version": "0.1.0", "license": "MIT", + "dependencies": { + "openapi-fetch": "^0.4.0" + }, "devDependencies": { "@size-limit/preset-small-lib": "^8.2.4", "husky": "^8.0.3", @@ -9163,6 +9166,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/openapi-fetch": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/openapi-fetch/-/openapi-fetch-0.4.0.tgz", + "integrity": "sha512-4lzZtH5J1ZH9EXfmpcmKi0gOgjy0hc6BAcucAdCmLHY6jZopMeGP51vD3Cd4rE1nTFMfJzmYDc8ar0+364gBVw==" + }, "node_modules/optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", diff --git a/package.json b/package.json index c975986..3d432a8 100644 --- a/package.json +++ b/package.json @@ -51,5 +51,8 @@ "tsdx": "^0.14.1", "tslib": "^2.5.2", "typescript": "^3.9.10" + }, + "dependencies": { + "openapi-fetch": "^0.4.0" } -} \ No newline at end of file +} diff --git a/src/impl/digilocker/schema/authpartner.schema.d.ts b/src/impl/digilocker/schema/authpartner.schema.d.ts new file mode 100644 index 0000000..249ba4b --- /dev/null +++ b/src/impl/digilocker/schema/authpartner.schema.d.ts @@ -0,0 +1,2219 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export interface paths { + "/oauth2/1/authorize": { + /** + * Get Authorization Code + * @description Call to this API starts authorization flow using OAuth 2.0 protocol. This isn't an API call—it's a DigiLocker web page that lets the user sign in to DigiLocker and authorize your application to access user’s data. After the user decides whether or not to authorize your app, they will be redirected to the redirect link provided by your application. + */ + get: operations["Get Authorization Code id"]; + }; + "/oauth2/1/token": { + /** + * Get Access Token + * @description This endpoint only applies to apps using the authorization code flow. An app calls this endpoint to acquire a bearer token once the user has authorized the app. Calls to /oauth2/1/token need to be authenticated using the app's key and secret. These can either be passed as application/x-www-form-urlencoded POST parameters (see parameters below) or via HTTP basic authentication. If basic authentication is used, the app key should be provided as the username, and the app secret should be provided as the password. + */ + post: operations["getaccesstoken id"]; + }; + "/oauth2/1/code": { + /** + * Get Device Code + * @description The client device calls the DigiLocker API to get the device code by providing the client_id issued to the device OEM and either the username or the mobile number of the user. DigiLocker responds with a device code and then sends an OTP on the mobile number and email address associated with the user’s account. The masked mobile number and email address is also sent in response. The device should use these values to notify the users about the mobile and email address on which the OTP has been sent. + */ + post: operations["Get Device Code id"]; + }; + "/oauth2/1/revoke": { + /** + * Revoke Token. + * @description Client applications can revoke a previously obtained refresh or access token when it is no longer needed. This is done by making a request to the token revocation endpoint. DigiLocker will invalidate the specified token and, if applicable, other tokens based on the same authorisation grant. This API may be used to sign out a user from DigiLocker. This API will work for server based web applications, mobile application and limited input devices. + */ + post: operations["get token revocation id"]; + }; + "/oauth2/1/user": { + /** + * Get User Details + * @description Client applications can call this API to get the DigiLocker Id, name, date of birth and gender of the account holder. An access token is required to call this API. The API will return the user details of the account with which the access token is linked. It is strongly recommended that the API can be called by client application only once after acquiring the access token. Since the user details do not change, the client application may store the values and use them when necessary than calling this API repeatedly. + */ + get: operations["Account Detail API id"]; + }; + "/oauth2/1/files/": { + /** + * Get List of Self Uploaded Documents + * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. + */ + get: operations["Get List of Self Uploaded Documents"]; + }; + "/oauth2/1/files/{id}": { + /** + * Get List of Self Uploaded Documents + * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. + */ + get: operations["Get List of Self Uploaded Documents id"]; + }; + "/oauth2/2/files/issued": { + /** + * Issued Documents + * @description Returns the list of meta-data about issued documents in user’s DigiLocker. + */ + get: operations["Get List of issued Documents id"]; + }; + "/oauth2/1/files/issued": { + /** + * Issued Documents + * @description Returns the list of meta-data about issued documents in user’s DigiLocker. + */ + get: operations["Get List of issued Documents Version1 id"]; + }; + "/oauth2/1/file/{uri}": { + /** + * Get File from URI + * @description Returns a file from URI. This API can be used to fetch both issued document and uploaded document. + */ + get: operations["Get File from URI id"]; + }; + "/oauth2/1/xml/{uri}": { + /** + * Get Certificate Data in XML Format from URI + * @description Returns the certificate data in machine readable XML format for a URI. This API can be used to only for issued documents. The XML data may not be available for all documents. If the XML data is available for a particular document, the mime parameter in Get List of Issued Documents API will contain application/xml. Please refer to Digital Locker XML Certificate Formats for more details of XML formats of various documents. + */ + get: operations["Get Certificate Data in XML Format from URI id"]; + }; + "/oauth2/2/xml/eaadhaar": { + /** + * Get e-Aadhaar Data in XML Format + * @description Returns e-Aadhaar data in XML format for the account. + */ + get: operations["Get e-Aadhaar Data in XML Format id"]; + }; + "/oauth2/1/file/upload": { + /** + * Upload file to locker + * @description This API can be used to save/upload a file to uploaded documents in DigiLocker. The allowed file types are JPG, JPEG, PNG and PDF. The file size must not exceed 10MB. + */ + post: operations["Upload File to Locker id"]; + }; + "/oauth2/1/pull/pulldocument": { + /** + * Pull Document + * @description This API allows a client application to search a document/certificate from issuer’s repository using the parameters provided by a user. The searched document is saved in user’s issued document section of DigiLocker if the search is successful. + */ + post: operations["Pull Document id"]; + }; + "/signup/2/demoauth": { + /** + * SIGN UP + * @description This API is used to validate Aadhaar details and verify the mobile number by generating an OTP. This API call, if successful, will be followed by verify OTP call by the partner application if the user is online or available to perform OTP validation as indicated in verification parameter + */ + post: operations["SIGN UP id"]; + }; + "/signup/1/demoauthverify": { + /** + * Verify OTP + * @description This API is used to verify the OTP sent by DigiLocker during the sign up API call above. + */ + post: operations["Verify OTP id"]; + }; + "/oauth2/1/pull/issuers": { + /** + * Get List of Issuers + * @description Returns the list of issuers registered with DigiLocker. + */ + post: operations["Get List of Issuers id"]; + }; + "/oauth2/1/pull/doctype": { + /** + * Get List of Documents Provided by an Issuer + * @description Returns a list of documents/certificates issued by an issuer organization registered with DigiLocker. + */ + post: operations["Get List of Documents Provided by an Issuer id"]; + }; + "/oauth2/1/pull/parameters": { + /** + * Get Search Parameters for a Document + * @description Returns a list of parameters required to search a document/certificate of an issuer organization registered with DigiLocker. These parameters are used to pull a document from issuer’s repository using Pull Document API mentioned in subsequent section. + */ + post: operations["Get Search Parameters for a Document id"]; + }; + "/account/2/verify": { + /** + * Verify Account + * @description This API can be used to verify whether a mobile number or Aadhaar number is already registered with DigiLocker. + */ + post: operations["Verify Account id"]; + }; + "/account/1/pushuri": { + /** + * Push URI to Account + * @description The API can use to push or delete a single URI into Digital Locker using DigiLocker Id acquired using Get User Details API. This API can be used to push the certificate details to Digital Locker as and when a certificate is generated in the issuer system. The issuing departments must register on DigiLocker as a registered Issuer and implement the requisite Issuer APIs as mentioned in Digital Locker Issuer API Specification document prior to pushing certificates using this API. + */ + post: operations["Push URI to Account id"]; + }; + "/statistics/1/counts": { + /** + * Get Statistics + * @description Returns DigiLocker statistics such as the count of users, authentic documents, issuers and requesters as on a specific date. + */ + post: operations["Get Statistics id"]; + }; +} + +export type webhooks = Record; + +export interface components { + schemas: { + AccessToken: { + /** @enum {string} */ + grant_type: "authorization_code"; + /** @example ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 */ + code?: string; + /** @example https://ndh.digitallocker.gov.in/oauth2-redirect.html */ + redirect_uri?: string; + /** @example a123456abca */ + code_verifier?: string; + /** @example ABCDEFG */ + client_id: string; + /** @example a123456abcdeghijk7890 */ + client_secret: string; + }; + AccessResponse: { + /** + * @description The access token that can be used to call the DigiLocker APIs. + * @example bc125c212a4b03a9a188a858be5a163f379e878a + */ + access_token: string; + /** + * Format: int64 + * @description The duration in seconds for which the access token is valid + * @example 3600 + */ + expires_in: number; + /** + * @description The type of token which will always be Bearer. + * @example Bearer + */ + token_type: string; + /** @description Scope of the token. */ + scope: string; + /** + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @example a47ab18c593703e4f83a274694db7422a8cfcb8f + */ + refresh_token: string; + /** + * @description A unique 36 character DigiLocker Id of the user account. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + digilocker_id: string; + /** + * @description The name of the user as registered with DigiLocker. + * @example Sunil Kumar + */ + name: string; + /** + * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. + * @enum {string} + */ + eaadhar: "Y" | "N"; + /** + * Format: dd-mm-yyy + * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. + * @example 31121970 + */ + dob: number; + /** + * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. + * @enum {string} + */ + gender: "M" | "F" | "T"; + /** + * @description A unique reference of the user account. + * @example 1c66bec26364cd6fefaabc6cae91840a + */ + reference_key: string; + }; + RefreshToken: { + /** @enum {string} */ + grant_type: "refresh_token"; + /** @example ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 */ + refresh_token: string; + /** @example ABCDEFG */ + client_id: string; + /** @example a123456abcdeghijk7890 */ + client_secret: string; + }; + RefreshAccessToken: { + /** @example refresh_token */ + grant_type: string; + /** @example a47ab18c593703e4f83a274694db7422a8cfcb8f */ + refresh_Token: string; + }; + DeviceAuthorizationCode: { + client_id?: string; + /** + * @description The parameter must be set to device_code. + * @example device_code + */ + response_type?: string; + /** + * @description Mobile number associated with DigiLocker account of the + * user. The client device accepts the mobile number on the device from user and sends it in this parameter. Either the username or the mobile number must be provided. + */ + dl_mobile?: number; + /** @description DigiLocker username of the user. The client device accepts the username on the device from user and sends the username in this parameter. Either the username or the mobile number must be provided. */ + dl_username?: string; + }; + DeviceAuthorizationCodeResponse: { + /** + * @description The device verification code. + * @example 74tq5miHKB + */ + device_code: string; + /** + * @description The masked mobile number on which the OTP is sent. + * @example XXXXXX1234 + */ + dl_masked_mobile: number; + /** + * @description The masked email on which the OTP is sent. + * @example xxxxxx@gmail.com + */ + dl_masked_email: string; + /** + * @description The duration in seconds for which the code is valid. + * @example 600 + */ + expires_in: number; + }; + DeviceAccessToken: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + client_id?: string; + /** + * @description The grant type, which must be “urn:ietf:params:oauth:grant-type:device_code”. + * @example urn:ietf:params:oauth:grant-type:device_code + */ + grant_type?: string; + /** @description The device verification code. The device_code field from Get Device Code Response. */ + device_code?: string; + /** @description The OTP collected from the user */ + dl_otp?: string; + }; + AuthTokenResponse: { + /** + * @description The access token that can be used to call the + * DigiLocker APIs. + * @example bc125c212a4b03a9a188a858be5a163f379e878a + */ + access_token: string; + /** + * Format: int64 + * @description The duration in seconds for which the access token is + * valid. + * @example 3600 + */ + expires_in: number; + /** + * @description The type of token which will always be Bearer. + * @example Bearer + */ + token_type: string; + /** @description Scope of the token. */ + scope: string; + /** + * @description The refresh token used to refresh the above access + * token when it expires. This will value will be + * returned only in case of web applications and not be + * returned for limited input devices. + * @example ad6f4004cc3e53f56bda391fe485fc4d32928061 + */ + refresh_token: string; + }; + FileUpload: { + /** @description The mime type of the file e.g. image/jpg, image/jpeg, image/png, application/pdf. */ + "Content-Type"?: string; + }; + FileUploadResponse: { + details?: { + /** @description The destination path of the file in DigiLocker including filename. */ + Path: string; + /** @description Size of file. */ + size: string; + }; + }; + DemoAuth: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description This is the mobile number of the user. DigiLocker will check whether an account exists for this mobile number. Either uid or mobile is required to verify whether an account exists. */ + mobile?: number; + /** @description This is name of the user as mentioned in Aadhaar. */ + name?: string; + /** @description This is date of birth of the user as mentioned in Aadhaar in DDMMYYYY format. */ + dob?: number; + /** + * @description This is gender of the user as mentioned in Aadhaar. The possible values are M, F, T for male, female and transgender respectively. + * @enum {unknown} + */ + gender?: "M" | "F" | "T"; + /** @description The parameter indicates whether the mobile number provided above should be validated by DigiLocker. If this parameter is ‘Y’, the DigiLocker sends an OTP to verify the mobile number. In this case the client application will call the second API to validate the OTP. The user will be signed on only after successful OTP validation. This flow should be used when the user account is created by user himself/herself or the user is present to provide the OTP. If this parameter is ‘N’, the user account will be created without OTP validation. The OTP validation will be performed when the user signs in for the first time in DigiLocker. This flow should be used when the user account needs to be created in the absence of the user. */ + verification?: string; + /** @description The consent indicator from the user for performing demographic authentication using Aadhaar details. This Partner Application must capture the user consent for performing the Aadhaar demographic authentication. The possible values are ‘Y’ and ‘N’. The sign up request will be processed only when this indicator is ‘Y’. */ + consent?: string; + /** @description The parameter indicates whether Aadhaar demographic authentication must be successful for creating DigiLocker account. The possible values are ‘Y’ and ‘N’. The value of ‘Y’ will perform Aadhaar demographic authentication and will return errors if any in response. The value of ‘N’ will also perform Aadhaar demographic authentication but will return any error in case of authentication failure. It will create a basic mobile based account for the user. Value ‘N’ should be used when the user account needs to be created in the absence of the user. */ + demoauth?: string; + /** @description This is the Aadhaar number of the user. DigiLocker will check whether an account exists for this Aadhaar number. Either uid or mobile is required to verify whether an account exists. */ + uid?: number; + }; + DemoAuthResponse: { + details?: { + /** + * @description The access token that can be used to call the DigiLocker APIs. + * @example bc125c212a4b03a9a188a858be5a163f379e878a + */ + access_token: string; + /** + * @description The duration in seconds for which the access token is valid. + * @example 3600 + */ + expires_in: string; + /** + * @description The type of token which will always be Bearer. + * @example Bearer + */ + token_type: string; + /** + * @description Scope of the token + * @example + */ + scope: string; + /** + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @example a47ab18c593703e4f83a274694db7422a8cfcb8f + */ + refresh_token: string; + /** + * @description The masked mobile number of the user on which the OTP has been sent. + * @example ******3712 + */ + mobile: number; + }; + }; + DemoAuthVerify: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description This is the mobile number of the user. DigiLocker will check whether an account exists for this mobile number. Either uid or mobile is required to verify whether an account exists. */ + mobile?: number; + /** @description The OTP provided by the user. */ + otp?: number; + }; + DemoAuthVerifyResponse: { + details?: { + /** + * @description The access token that can be used to call the DigiLocker APIs. + * @example bc125c212a4b03a9a188a858be5a163f379e878a + */ + access_token: string; + /** + * @description The duration in seconds for which the access token is valid. + * @example 3600 + */ + expires_in: string; + /** + * @description The type of token which will always be Bearer. + * @example Bearer + */ + token_type: string; + /** + * @description Scope of the token + * @example + */ + scope: string; + /** + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @example a47ab18c593703e4f83a274694db7422a8cfcb8f + */ + refresh_token: string; + }; + }; + IssuerResponse: { + issuers: ({ + name: string; + description: string; + categories: string; + issuerid: string; + orgid: string; + })[]; + }; + Issuer: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + }; + DocType: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description The organization id for the issuer in DigiLocker. This organization id is returned in Get List of Issuers API mentioned earlier. */ + orgid?: string; + }; + DocTypeResponse: { + documents: ({ + doctype: string; + description: string; + })[]; + }; + SearchParameters: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description The organization id for the issuer in DigiLocker. This organization id is returned in Get List of Issuers API mentioned earlier. */ + orgid?: string; + /** @description A 5 character unique document type provided by DigiLocker. */ + doctype?: string; + }; + SearchParametersResponse: ({ + label: string; + paramname: string; + valuelist?: unknown; + example: string; + })[]; + VerifyAccount: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description This is the mobile number of the user. DigiLocker will check whether an account exists for this mobile number. Either uid or mobile is required to verify whether an account exists. */ + mobile?: number; + /** @description This is the Aadhaar number of the user. DigiLocker will check whether an account exists for this Aadhaar number. Either uid or mobile is required to verify whether an account exists. */ + uid?: number; + }; + VerifyAccountResponse: { + /** + * @description true indicates that the provided Aadhaar/mobile number is already registered and false indicates otherwise. + * @example true + */ + registered: string; + /** + * @description A unique 36 character DigiLocker Id of the user account. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + digilockerid: string; + }; + PushUri: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + /** @description A unique number of the document. This id will be unique within the document type issued by the issuer. */ + docid?: string; + /** @description This is the unique identifier of the document. */ + uri?: string; + /** @description This is the DigiLocker Id of the user that was acquired using Get User Details API. */ + digilockerid?: number; + /** @description The issue date of the document in DDMMYYYY format. */ + issuedate?: string; + /** @description The date from which the document is valid in DDMMYYYY format. This may be same as the issue date. */ + validfrom?: number; + /** @description The expiry date of the document in DDMMYYYY format. */ + validto?: string; + /** @description Action that needs to be taken for the Aadhaar number and URI combination. Possible values are A for adding a new URI, U for updating an already added URI details or D for deleting the URI. */ + action?: string; + }; + GetStatistics: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + clientid?: string; + /** + * Format: binary + * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. + */ + hmac?: string; + /** @description Provide a timestamp value in UNIX (or POSIX) format in IST time zone in seconds. This timestamp value must not be older than 30 minutes. */ + ts?: string; + }; + GetStatisticsResponse: { + /** + * @description Count of registered users on DigiLocker. + * @example 25873490 + */ + users: string; + /** + * @description Count of authentic documents available through DigiLocker. + * @example 3520475277 + */ + authentic_documents: string; + /** + * @description Count of issuer organizations registered on DigiLocker. + * @example 134 + */ + issuers: string; + /** + * @description Count of requester organizations registered on DigiLocker. + * @example 45 + */ + requestors: string; + /** + * @description The date on which this statistics is generated. + * @example 31072019 + */ + count_as_on: string; + /** @description List of last 12 months cumulative user registrations */ + monthwise_registations: { + /** + * @description Unique id of the list item. + * @example 18496 + */ + id?: number; + /** + * @description Month of the year in numeric format with January as 1 + * @example 5 + */ + month?: number; + /** + * @description Year in YYYY format + * @example 2018 + */ + year?: number; + /** + * @description Count of cumulative user registrations in the given month. + * @example 124794 + */ + count?: number; + details2?: { + /** + * @description Unique id of the list item. + * @example 18496 + */ + id?: number; + /** + * @description Month of the year in numeric format with January as 1 + * @example 5 + */ + month?: number; + /** + * @description Year in YYYY format + * @example 2018 + */ + year?: number; + /** + * @description Count of cumulative user registrations in the given month. + * @example 124794 + */ + count?: number; + }; + }; + /** @description List of cumulative year-wise counts of authentic documents in DigiLocker. */ + yearwise_authentic_documents: { + /** + * @description Unique id of the list item. + * @example 18347 + */ + id?: number; + /** + * @description Year in YYYY format. + * @example 2016 + */ + year?: number; + /** + * @description Count of cumulative user authentic documents in + * the given year. + * @example 10134567 + */ + count?: number; + details?: { + /** + * @description Unique id of the list item. + * @example 18350 + */ + id?: number; + /** + * @description Year in YYYY format. + * @example 2017 + */ + year?: number; + /** + * @description Count of cumulative user authentic documents in the given year. + * @example 1000548093 + */ + count?: number; + }; + details1?: { + /** + * @description Unique id of the list item. + * @example 18354 + */ + id?: number; + /** + * @description Year in YYYY format. + * @example 2018 + */ + year?: number; + /** + * @description Count of cumulative user authentic documents in the given year. + * @example 2410543684 + */ + count?: number; + }; + details2?: { + /** + * @description Unique id of the list item. + * @example 18567 + */ + id?: number; + /** + * @description Year in YYYY format. + * @example 2019 + */ + year?: number; + /** + * @description Count of cumulative user authentic documents in the given year. + * @example 3520475277 + */ + count?: number; + }; + }; + }; + XMLFormatSchema: { + CertificateData: (unknown)[]; + Signature: { + SignedInfo?: unknown; + SignatureValue?: unknown; + KeyInfo: { + X509Data?: unknown; + }; + }; + }; + EaadharXamlSchema: { + KycRes: { + Rar: string; + UidData: { + Poi: { + dob: string; + gender: string; + name: string; + }; + Poa: { + co: string; + country: string; + dist: string; + lm: string; + loc: string; + pc: string; + state: string; + vtc: string; + }; + LData: { + co: string; + country: string; + dist: string; + lang: string; + lm: string; + loc: string; + name: string; + pc: string; + state: string; + vtc: string; + }; + Pht: string; + Prn: { + type: string; + text: string; + }; + tkn: string; + uid: string; + }; + Signature: { + SignedInfo: { + CanonicalizationMethod: { + Algorithm: string; + }; + SignatureMethod: { + Algorithm: string; + }; + Reference: { + Transforms: { + Transform: { + Algorithm: string; + }; + }; + DigestMethod: { + Algorithm: string; + }; + DigestValue: string; + URI: string; + }; + }; + SignatureValue: string; + KeyInfo: { + X509Data: { + X509SubjectName: string; + X509Certificate: string; + }; + }; + xmlns: string; + }; + code: string; + ret: string; + ts: string; + ttl: string; + txn: string; + }; + }; + PullDocumentSchema: { + /** @description The organization id for the issuer in DigiLocker. This organization id is returned in Get List of Issuers API mentioned above. */ + orgid?: string; + /** @description A 5 character unique document type provided by DigiLocker. */ + doctype?: string; + /** @description The consent indicator from the user for performing demographic authentication using Aadhaar details. This Partner Application must capture the user consent for performing the Aadhaar demographic authentication. The possible values are ‘Y’ and ‘N’. The sign up request will be processed only when this indicator is ‘Y’. */ + consent?: string; + /** @description Other parameters required for fetching a document as listed in paramname field of Get Search Parameters API. */ + reg_no?: string; + /** @description Other parameters required for fetching a document as listed in paramname field of Get Search Parameters API. */ + chasis_no?: string; + }; + ResponseOne: { + /** @description invalid_response_type */ + error?: string; + /** @description The response_type parameter is invalid */ + error_description?: string; + }; + ResponseTwo: { + /** @description invalid_username */ + error?: string; + /** @description The dl_username parameter is invalid */ + error_description?: string; + }; + ResponseThree: { + /** @description invalid_mobile */ + error?: string; + /** @description The dl_mobile parameter is invalid */ + error_description?: string; + }; + ResponseFour: { + /** @description multiple_mobile_accounts */ + error?: string; + /** @description The mobile number provided is associated with more than one DigiLocker accounts. Please login using username. */ + error_description?: string; + }; + ResponseFive: { + /** @description otp_error */ + error?: string; + /** @description OTP could not be sent as the account may not have a valid mobile or a valid email. */ + error_description?: string; + }; + ResponseSix: { + /** @description unexpected_error */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + ResponseSeven: { + /** @description partner_service_unresponsive */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response1: { + /** @description repository_service_inactive */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response2: { + /** @description repository_service_unpublished */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response3: { + /** @description repository_service_unresponsive */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response4: { + /** @description repository_service_configerror */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response5: { + /** @description repository_service_resperror */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response6: { + /** @description repository_service_exception */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + Response7: { + /** @description parameter_missing */ + error?: string; + /** @description One or more of the mandatory parameters is missing */ + error_description?: string; + }; + Response8: { + /** @description invalid_ts */ + error?: string; + /** @description Timestamp parameter is invalid */ + error_description?: string; + }; + Response9: { + /** @description hmac_mismatch */ + error?: string; + /** @description HMAC does not match */ + error_description?: string; + }; + Response10: { + /** @description mobile_exists */ + error?: string; + /** @description A DigiLocker account already exists with this mobile number. */ + error_description?: string; + }; + Response11: { + /** @description auth_failure */ + error?: string; + /** @description The data on Aadhaar does not match with one or more of Aadhaar, Name, DOB and Gender data provided. Aadhaar demographic authentication failure. */ + error_description?: string; + }; + Response12: { + /** @description invalid_parameter */ + error?: string; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  uid parameter is missing or invalid  Name parameter is missing or invalid  Dob parameter is missing or invalid  Gender parameter is missing or invalid  Mobile parameter is missing or invalid  Verification parameter is missing or invalid  Consent parameter is missing or invalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: string; + }; + Response13: { + /** @description repository_service_configerror */ + error?: string; + /** @description The issuer service is not available. Please contact DigiLocker support. */ + error_description?: string; + }; + Response14: { + /** @description invalid_orgid */ + error?: string; + /** @description The orgid parameter is missing or invalid. */ + error_description?: string; + }; + Response15: { + /** @description invalid_doctype */ + error?: string; + /** @description The doctype parameter is missing or invalid. */ + error_description?: string; + }; + Response16: { + /** @description pull_response_pending */ + error?: string; + /** @description The details provided above do not exactly match with the details on the certificate. Your request has been forwarded to the Issuer department. The Issuer department will verify the details provided above. If the verification is successful, your certificate will be made available in the Issued Documents section of your DigiLocker. */ + error_description?: string; + }; + Response17: { + /** @description uri_exists */ + error?: string; + /** @description This document already exists in your Issued Documents. */ + error_description?: string; + }; + Response18: { + /** @description aadhaar_not_linked */ + error?: string; + /** @description To access issued documents, please link your Aadhaar number to your DigiLocker account. */ + error_description?: string; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} + +export type external = Record; + +export interface operations { + + /** + * Get Authorization Code + * @description Call to this API starts authorization flow using OAuth 2.0 protocol. This isn't an API call—it's a DigiLocker web page that lets the user sign in to DigiLocker and authorize your application to access user’s data. After the user decides whether or not to authorize your app, they will be redirected to the redirect link provided by your application. + */ + "Get Authorization Code id": { + parameters: { + query: { + /** @description Provide the client id that was created during the application registration process on Partners Portal. */ + client_id?: string; + /** @description Provide the grant type requested, either token or code. */ + response_type: string; + /** @description The URI to redirect the user after authorization has completed. */ + redirect_uri: string; + /** @description This is your application specific data that will be passed back to your application through redirect_uri. */ + state: string; + /** + * @description A unique random string called code verifier (code_verifier) is + * created by the client application for every authorization request. + * The code_challenge sent as this parameter is the Base64URL (with no + * padding) encoded SHA256 hash of the code verifier. + * Code block: + * + * ``` + * string base64_url_encode_without_padding(string arg) + * { + * string s = base64encode(arg); //Regular base64encoder with padding + * s = s.replace(’=’,’’); //Remove any trailing ’=’ + * s = s.replace(’+’, ’-’); //Replace ’+’ with ’-’ + * s = s.replace(’/’, ’_’); //Replace ’/’ with ’_’ return s; + * } + * ``` + */ + Code_challenge?: string; + /** @description Specifies what method was used to encode a code_verifier to generate code_challenge parameter above. This parameter must be used with the code_challenge parameter. The only supported values for this parameter is S256. */ + Code_challenge_method?: string; + /** @description If this parameter is provided its value will always be signup. This parameter indicates that the user does not have a DigiLocker account and will be directed to the signup flow directly. After the account is created, the user will be directed to the authorization flow. If this parameter is not sent, the user will be redirected to the sign in flow. */ + dl_flow?: string; + /** @description Verified mobile number of the user. If this parameter is passed, DigiLocker will skip the mobile OTP verification step during sign up. DigiLocker will treat the mobile number passed in this parameter as a verified mobile number by the trusted client application. This parameter will be used only if dl_flow parameter mentioned above is set to signup and will be ignored otherwise. */ + Verified_mobile?: number; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + details?: { + access_token: string; + expires_in: number; + token_type: string; + scope: string; + }; + }; + }; + }; + /** @description Invalid status value */ + 400: never; + }; + }; + /** + * Get Access Token + * @description This endpoint only applies to apps using the authorization code flow. An app calls this endpoint to acquire a bearer token once the user has authorized the app. Calls to /oauth2/1/token need to be authenticated using the app's key and secret. These can either be passed as application/x-www-form-urlencoded POST parameters (see parameters below) or via HTTP basic authentication. If basic authentication is used, the app key should be provided as the username, and the app secret should be provided as the password. + */ + "getaccesstoken id": { + /** @description Details of documents being created. */ + requestBody: { + content: { + "application/json": { + "Get access token using authorization code"?: components["schemas"]["AccessToken"]; + "Get access token using refresh token"?: components["schemas"]["RefreshToken"]; + "Get access token using device code and OTP"?: components["schemas"]["DeviceAccessToken"]; + }; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["AccessResponse"]; + }; + }; + /** @description Bad request */ + 400: never; + /** @description If the access token is expired or has been revoked by DigiLocker user. */ + 401: never; + }; + }; + /** + * Get Device Code + * @description The client device calls the DigiLocker API to get the device code by providing the client_id issued to the device OEM and either the username or the mobile number of the user. DigiLocker responds with a device code and then sends an OTP on the mobile number and email address associated with the user’s account. The masked mobile number and email address is also sent in response. The device should use these values to notify the users about the mobile and email address on which the OTP has been sent. + */ + "Get Device Code id": { + requestBody?: { + content: { + "application/json": components["schemas"]["DeviceAuthorizationCode"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["DeviceAuthorizationCodeResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["ResponseOne"] | components["schemas"]["ResponseTwo"] | components["schemas"]["ResponseThree"] | components["schemas"]["ResponseFour"]; + }; + }; + /** @description The client_id parameter is invalid. */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["ResponseFive"] | components["schemas"]["ResponseSix"]; + }; + }; + }; + }; + /** + * Revoke Token. + * @description Client applications can revoke a previously obtained refresh or access token when it is no longer needed. This is done by making a request to the token revocation endpoint. DigiLocker will invalidate the specified token and, if applicable, other tokens based on the same authorisation grant. This API may be used to sign out a user from DigiLocker. This API will work for server based web applications, mobile application and limited input devices. + */ + "get token revocation id": { + requestBody?: { + content: { + "application/json": { + /** @description The token that needs to be revoked. */ + token: string; + /** + * @description The type of the above token. The value will be one of access_token or refresh_token. If this parameter is not sent, DigiLocker will look for this token in both access and refresh tokens and then revoke it. + * @enum {string} + */ + token_type_hint?: "refresh_token" | "access_token"; + }; + }; + }; + responses: { + /** @description successful operation */ + 200: never; + /** @description The token is invalid */ + 400: never; + }; + }; + /** + * Get User Details + * @description Client applications can call this API to get the DigiLocker Id, name, date of birth and gender of the account holder. An access token is required to call this API. The API will return the user details of the account with which the access token is linked. It is strongly recommended that the API can be called by client application only once after acquiring the access token. Since the user details do not change, the client application may store the values and use them when necessary than calling this API repeatedly. + */ + "Account Detail API id": { + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + details?: { + /** + * @description A unique 36 character DigiLocker Id of the user account. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + digilockerid: string; + /** + * @description The name of the user as registered with DigiLocker. + * @example Sunil Kumar + */ + name: string; + /** + * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. + * @enum {string} + */ + eaadhar?: "Y" | "N"; + /** + * Format: dd-mm-yyy + * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. + * @example 31121970 + */ + dob: string; + /** + * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. + * @enum {string} + */ + gender: "M" | "F" | "T"; + }; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + content: { + "application/json": { + /** @example unexpected_error */ + error?: string; + /** @example Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; + /** + * Get List of Self Uploaded Documents + * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. + */ + "Get List of Self Uploaded Documents": { + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + directory: string; + items: ({ + /** @example 189079894 */ + id: string; + name: string; + type: string; + size: string; + date: string; + parent: string; + mime: string; + uri: string; + description: string; + issuer: string; + })[]; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @example invalid_id */ + error?: string; + /** @example The folder does not exist */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @example unexpected_error */ + error?: string; + /** @example Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; + /** + * Get List of Self Uploaded Documents + * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. + */ + "Get List of Self Uploaded Documents id": { + parameters: { + path: { + /** @description The id of the folder to list. To list the files of root folder of a user’s locker, do not send this parameter. This is sent as a part of the URL. */ + id: string; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + details?: { + /** + * @description The name of the file or folder. + * @example My Documents + */ + name: string; + /** + * @description String dir for folder and string file for file. + * @example dir + */ + type: string; + /** + * @description The id if this item is a folder. + * @example 5678 + */ + id: number; + /** + * @description Size of file or folder. + * @example 366481 + */ + size: string; + /** + * @description This contains the date of file upload in case of self uploaded documents + * @example 2015-05-12T15:50:38Z + */ + date: string; + /** + * @description The id of the parent folder. + * @example 1234 + */ + parent: string; + /** + * @description The mime type of the file. This field will contain “application/PDF” for PDF files; “image/png” for PNG files and “image/jpg” or “image/jpeg” for JPG/JPEG files. This will be blank in case of folder. + * @example + */ + mime: string; + /** + * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. URI will be blank in case of folder. + * @example + */ + uri: string; + /** + * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. + * @example + */ + description: string; + /** + * @description The name of the issuer. This is blank in case of uploaded documents and folders. + * @example + */ + issuer: string; + }; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @example invalid_id */ + error?: string; + /** @example The folder does not exist */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @example unexpected_error */ + error?: string; + /** @example Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; + /** + * Issued Documents + * @description Returns the list of meta-data about issued documents in user’s DigiLocker. + */ + "Get List of issued Documents id": { + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + items: ({ + name: string; + type: string; + size: string; + date: string; + parent: string; + mime?: (unknown)[]; + uri: string; + doctype: string; + description: string; + issuerid: string; + issuer: string; + })[]; + resource: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["ResponseSix"] | components["schemas"]["ResponseSeven"]; + }; + }; + }; + }; + /** + * Issued Documents + * @description Returns the list of meta-data about issued documents in user’s DigiLocker. + */ + "Get List of issued Documents Version1 id": { + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + details?: { + /** + * @description The name of the certificate. + * @example Class XII Marksheet + */ + name: string; + /** + * @description String file. + * @example file + */ + type: string; + /** + * @description This will be blank. + * @example + */ + size: string; + /** + * @description This contains the date on which the certificate was last modified in DigiLocker. + * @example 2015-05-12T15:50:38Z + */ + date: string; + /** + * @description This will be blank. + * @example + */ + parent: string; + /** + * @description The list of mime types for the certificate data. This field will contain “application/PDF” or “application/xml”. + * @example application/pdf + */ + mime: string; + /** + * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. + * @example in.gov.cbse-HSCER-201412345678 + */ + uri: string; + /** + * @description A 5 character unique document type provided by DigiLocker. + * @example HSCER + */ + doctype: string; + /** + * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. + * @example Class XII Marksheet + */ + description: string; + /** + * @description The name of the issuer. + * @example CBSE + */ + issuer: string; + /** + * @description Unique DigiLocker issuer id as mentioned in the URI. + * @example in.gov.cbse + */ + issuerid: string; + }; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["ResponseSix"] | components["schemas"]["ResponseSeven"]; + }; + }; + }; + }; + /** + * Get File from URI + * @description Returns a file from URI. This API can be used to fetch both issued document and uploaded document. + */ + "Get File from URI id": { + parameters: { + path: { + /** @description This is the unique identifier of the document. */ + uri: string; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/pdf": string; + "image/jpg": string; + "image/jpeg": string; + "image/png": string; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @example uri_missing */ + error?: string; + /** @example URI parameter missing */ + error_description?: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @example invalid_uri */ + error?: string; + /** @example No file found for given URI */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + }; + }; + /** @description Gateway timeout */ + 503: { + content: { + "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + }; + }; + }; + }; + /** + * Get Certificate Data in XML Format from URI + * @description Returns the certificate data in machine readable XML format for a URI. This API can be used to only for issued documents. The XML data may not be available for all documents. If the XML data is available for a particular document, the mime parameter in Get List of Issued Documents API will contain application/xml. Please refer to Digital Locker XML Certificate Formats for more details of XML formats of various documents. + */ + "Get Certificate Data in XML Format from URI id": { + parameters: { + path: { + uri: string; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/xml": components["schemas"]["XMLFormatSchema"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @example uri_missing */ + error?: string; + /** @example URI parameter missing */ + error_description?: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @example invalid_uri */ + error?: string; + /** @example No file found for given URI */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + }; + }; + /** @description Gateway timeout */ + 503: { + content: { + "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + }; + }; + }; + }; + /** + * Get e-Aadhaar Data in XML Format + * @description Returns e-Aadhaar data in XML format for the account. + */ + "Get e-Aadhaar Data in XML Format id": { + responses: { + /** @description successful operation */ + 200: { + content: { + "application/xml": components["schemas"]["EaadharXamlSchema"]; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @enum {unknown} */ + error?: "aadhaar_not_linked" | "aadhaar_not_available"; + /** @enum {unknown} */ + error_description?: "Aadhaar is not linked to the account" | "Aadhaar data is not available for this user. Please perform Aadhaar eKYC again."; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + }; + }; + /** @description Gateway timeout */ + 503: { + content: { + "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + }; + }; + }; + }; + /** + * Upload file to locker + * @description This API can be used to save/upload a file to uploaded documents in DigiLocker. The allowed file types are JPG, JPEG, PNG and PDF. The file size must not exceed 10MB. + */ + "Upload File to Locker id": { + parameters: { + header?: { + /** @description The destination path of the file in DigiLocker including filename. */ + path?: string; + /** @description This is used to verify the integrity of the file data. The client app calculates the hash message authentication code (HMAC) of the file content using SHA256 hashing algorithm and the client secret as the hashing key. The resulting HMAC is converted to Base64 format and sent in this parameter. Upon upload of file, DigiLocker calculates the HMAC of the file data and compares it with this HMAC.. */ + hmac?: string; + }; + }; + requestBody?: { + content: { + "application/octet-stream": components["schemas"]["FileUpload"]; + "image/png": string; + "image/jpeg": string; + "image/jpg": string; + "image/pdf": string; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["FileUploadResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @enum {unknown} */ + error?: "path_missing" | "contenttype_missing" | "hmac_missing" | "filename_missing" | "hmac_mismatch" | "invalid_filename" | "invalid_filesize" | "invalid_filetype" | "invalid_path" | "file_data_missing" | "mimetype_mismatch"; + /** @enum {unknown} */ + error_description?: "Path parameter is missing" | "Content-Type parameter is missing" | "HMAC parameter is missing" | "Filename is missing in path parameter" | "HMAC does not match" | "Restricted characters are not allowed in file name" | "The file size exceeds maximum allowed file size of 10MB" | "The file type is not allowed" | "The destination folder does not exist" | "Missing file content in the request" | "The mimetype provided in Content-Type parameter does not match with the mimetype of the file"; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; + /** + * Pull Document + * @description This API allows a client application to search a document/certificate from issuer’s repository using the parameters provided by a user. The searched document is saved in user’s issued document section of DigiLocker if the search is successful. + */ + "Pull Document id": { + requestBody?: { + content: { + "application/x-www-form-urlencoded": components["schemas"]["PullDocumentSchema"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": { + details?: { + uri: string; + }; + }; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": components["schemas"]["Response13"] | components["schemas"]["ResponseSix"]; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_token */ + error?: string; + /** @example The access token is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @description record_not_found */ + error?: unknown; + /** @description No record found in issuer database for given criteria. Please check the details and try again. If problem persists, see the FAQ section for possible causes. */ + error_description?: unknown; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": components["schemas"]["Response14"] | components["schemas"]["Response15"] | components["schemas"]["Response16"] | components["schemas"]["Response17"] | components["schemas"]["Response18"]; + }; + }; + }; + }; + /** + * SIGN UP + * @description This API is used to validate Aadhaar details and verify the mobile number by generating an OTP. This API call, if successful, will be followed by verify OTP call by the partner application if the user is online or available to perform OTP validation as indicated in verification parameter + */ + "SIGN UP id": { + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["DemoAuth"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["DemoAuthResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": components["schemas"]["Response10"] | components["schemas"]["Response11"] | components["schemas"]["Response12"]; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Verify OTP + * @description This API is used to verify the OTP sent by DigiLocker during the sign up API call above. + */ + "Verify OTP id": { + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["DemoAuthVerify"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["DemoAuthVerifyResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": components["schemas"]["Response7"] | components["schemas"]["Response8"] | components["schemas"]["Response9"]; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Get List of Issuers + * @description Returns the list of issuers registered with DigiLocker. + */ + "Get List of Issuers id": { + requestBody?: { + content: { + "application/x-www-form-urlencoded": components["schemas"]["Issuer"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["IssuerResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @example invalid_parameter */ + error?: string; + /** @example One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Get List of Documents Provided by an Issuer + * @description Returns a list of documents/certificates issued by an issuer organization registered with DigiLocker. + */ + "Get List of Documents Provided by an Issuer id": { + requestBody?: { + content: { + "application/x-www-form-urlencoded": components["schemas"]["DocType"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["DocTypeResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @description invalid_parameter */ + error?: unknown; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  The orgid parameter is missing or invalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: unknown; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Get Search Parameters for a Document + * @description Returns a list of parameters required to search a document/certificate of an issuer organization registered with DigiLocker. These parameters are used to pull a document from issuer’s repository using Pull Document API mentioned in subsequent section. + */ + "Get Search Parameters for a Document id": { + requestBody?: { + content: { + "application/x-www-form-urlencoded": components["schemas"]["SearchParameters"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["SearchParametersResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @description invalid_parameter */ + error?: unknown; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  The orgid parameter is missing or invalid  The doctype parameter is missing or invalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: unknown; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @example invalid_client_id */ + error?: string; + /** @example The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Verify Account + * @description This API can be used to verify whether a mobile number or Aadhaar number is already registered with DigiLocker. + */ + "Verify Account id": { + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["VerifyAccount"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["VerifyAccountResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @description invalid_parameter */ + error?: unknown; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Either one of uid or mobile number is mandatory  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: unknown; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @description invalid_client_id */ + error?: string; + /** @description The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: unknown; + /** @description Internal server error */ + error_description?: unknown; + }; + }; + }; + }; + }; + /** + * Push URI to Account + * @description The API can use to push or delete a single URI into Digital Locker using DigiLocker Id acquired using Get User Details API. This API can be used to push the certificate details to Digital Locker as and when a certificate is generated in the issuer system. The issuing departments must register on DigiLocker as a registered Issuer and implement the requisite Issuer APIs as mentioned in Digital Locker Issuer API Specification document prior to pushing certificates using this API. + */ + "Push URI to Account id": { + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["PushUri"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": unknown; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @description invalid_parameter */ + error?: string; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  URI parameter is missing or invalid  Doctype parameter is missing or invalid  Description parameter is missing or invalid  Docid parameter is missing or invalid  Issuedate parameter is missing orinvalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid  URI already exists in this account  URI already exists in another account */ + error_description?: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @description invalid_client_id */ + error?: string; + /** @description The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Not found */ + 404: { + content: { + "application/json": { + /** @description invalid_digilocker_id */ + error?: string; + /** @description The digilockerid parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; + /** + * Get Statistics + * @description Returns DigiLocker statistics such as the count of users, authentic documents, issuers and requesters as on a specific date. + */ + "Get Statistics id": { + requestBody?: { + content: { + "multipart/form-data": components["schemas"]["GetStatistics"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/json": components["schemas"]["GetStatisticsResponse"]; + }; + }; + /** @description Bad request */ + 400: { + content: { + "application/json": { + /** @description invalid_parameter */ + error?: string; + /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ + error_description?: string; + }; + }; + }; + /** @description Unauthorized error */ + 401: { + content: { + "application/json": { + /** @description invalid_client_id */ + error?: string; + /** @description The client_id parameter is invalid */ + error_description?: string; + }; + }; + }; + /** @description Internal Error */ + 500: { + content: { + "application/json": { + /** @description unexpected_error */ + error?: string; + /** @description Internal server error */ + error_description?: string; + }; + }; + }; + }; + }; +} diff --git a/src/impl/digilocker/schema/issuer.schema.d.ts b/src/impl/digilocker/schema/issuer.schema.d.ts new file mode 100644 index 0000000..fa312f8 --- /dev/null +++ b/src/impl/digilocker/schema/issuer.schema.d.ts @@ -0,0 +1,263 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + + +export interface paths { + "/Your Pull URI Request API Path": { + /** + * Pull URI Request API . + * @description The Pull URI Request API has to be implemented by the issuers and will be consumed by Digital Locker application. This API will be invoked when a citizen searches the issuer repository for his/her certificate. If the certificate data is Aadhaar seeded, the issuer may choose to use Aadhaar number as the search parameter. Digital Locker provides Aadhaar number, name and date of birth as on Aadhaar to the issuer API as additional parameters. The option for these Aadhaar based parameters can be selected while configuring this API in Digital Locker Partner’s Portal. If the certificate data is not Aadhaar seeded then the issuer may use any other unique parameter e.g. driving license number to search for a driving license. These custom parameters will be passed in the UDF elements as shown in the sample request below. The custom parameter(s) can be configured while configuring the API in the DigiLocker Partner’s Portal. The Digital Locker system will query the issuer repository to fetch the URI for any document that match the search criteria. The citizen can save this URI in his/her Digital Locker. It is strongly recommended that the issuer API validate that the name, date of birth details sent by DigiLocker in Aadhaar parameters match with the corresponding details on the certificate before returning the certificate data. This will ensure that only authentic owners get access to a certificate. + */ + post: operations["Pull Uri"]; + }; + "/Your Pull DOC Request API Path": { + /** + * Pull Doc Request API. + * @description The Pull Doc Request API has to be implemented by the issuers and will be consumed by Digital Locker system. This API will be invoked when the resident clicks on the URI displayed in the Issued documents section of DigLocker. The issuer API will by sending the certificate data. The certificate data should be sent in one of the two formats depending on the request send by Digital Locker:|- a. PDF document format b. XML format for machine readable metadata + */ + post: operations["Pull Doc"]; + }; +} + +export type webhooks = Record; + +export interface components { + schemas: { + PullURIRequest: { + /** @description API version. */ + ver: string; + /** @description A timestamp value. This will be used to decode the keyHash element described below. */ + ts: string; + /** @description Transaction id. */ + txn: string; + /** @description Org Id is the user id provided to the Digital Locker application by the issuer application for accessing the API. */ + orgId: string; + /** + * @description Indicates the desired format of the certificate data in the response. Possible values of this attribute are: + * xml: for certificate data in machine readable xml format. + * pdf: for certificate data in printable pdf format + * both: for certificate data in both xml and pdf format. If the format attribute is not present in the request, then the API must return Base64 encoded PDF data in the response. Please see the response section below for more details + */ + format: string; + DocDetails: { + /** + * @description Digital Locker will pass the document type being searched in this parameter. + * @example Pdf + */ + DocType: string; + /** + * @description A unique 36 character DigiLocker Id of the user account. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + DigiLockerId: string; + /** + * @description Aadhaar number of the DigiLocker user searching for the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example 123443211122 + */ + UID: string; + /** + * @description Name of the DigiLocker user searching for the document/certificate as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example Sunil + */ + FullName: string; + /** + * @description Date of birth of the DigiLocker user searching for the document/certificate as on Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example 09-08-1989 + */ + DOB: string; + /** @description The base 64 encoded contents of JPEG photograph as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. */ + Photo: string; + /** @description User defined search parameters to search a unique document/certificate. The may be for CBSE, for Transportation Dept. and for Income Tax Dept. The search parameters for the API will be configured in the issuer portal of Digital Locker while configuring this API. */ + UDF1: string; + UDF2: string; + UDF3: string; + UDFn: string; + }; + }; + PullURIResponse: { + ResponseStatus: { + /** @description 1 for success, 0 for error and 9 for pending. */ + Status: string; + /** @description A timestamp value as sent in the request. */ + ts: string; + /** @description Transaction id value as sent in the request. */ + txn: string; + }; + /** @description Issuer can add meta content specific to document here. */ + DocDetails: { + /** + * @description The document type sent in the original request. + * @example INCER + */ + DocType: string; + /** + * @description A unique 36 character DigiLocker Id as sent in the original request. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + DigiLockerId: string; + /** + * @description The Aadhaar number if sent in the original request. + * @example 123412341234 + */ + UID: string; + /** + * @description The full name if sent in the original request. + * @example Sunil Kumar + */ + FullName: string; + /** + * @description The date of birth if sent in the original request. + * @example 31-12-1990 + */ + DOB: string; + /** + * @description Search parameters sent in the original request. + * @example 1333 + */ + UDF1: string; + /** + * @description Search parameters sent in the original request. + * @example 2016 + */ + UDF2: string; + /** + * @description URI corresponding to the search criteria that identifies the document uniquely. + * @example in.gov.dept.state-INCER-1234567 + */ + URI: string; + /** @description Enclose the Base64 byte encoded contents of PDF file in this element. */ + DocContent: string; + /** @description Enclose the base64 byte encoded certificate metadata in XML format. The DataContent element should be sent only if the original request contains format attribute as “xml” or “both”. */ + DataContent: string; + }; + }; + PullDocRequest: { + /** @description API version. */ + ver: string; + /** @description A timestamp value. This will be used to decode the keyHash element described below. */ + ts: string; + /** @description Transaction id. */ + txn: string; + /** @description Org Id is the user id provided to the Digital Locker application by the issuer application for accessing the API. */ + orgId: string; + /** + * @description The certificate data in the response. Possible values of this attribute are: + * xml: for certificate data in machine readable xml format + * pdf: for certificate data in printable pdf format + * both: for certificate data in both xml and pdf format. If the format attribute is not present in the request, then the API must return Base64 encoded PDF data in the response. Please see the response section below for more details. + */ + format: string; + DocDetails: { + /** + * @description URI identifies the document uniquely. + * @example in.gov.kerala.edistrict-INCER-123456 + */ + URI: string; + /** + * @description A unique 36 character DigiLocker Id of the user account. + * @example 123e4567-e89b-12d3-a456-426655440000 + */ + DigiLockerId: string; + /** + * @description Aadhaar number of the DigiLocker user accessing the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example 123456789012 + */ + UID: string; + /** + * @description Name of the DigiLocker user accessing the document/certificate as in Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example Sunil Kumar + */ + FullName: string; + /** + * @description Date of birth of the DigiLocker user accessing the document/certificate as in Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @example 31-12-1990 + */ + DOB: string; + }; + }; + PullDocResponse: { + ResponseStatus: { + /** @description 1 for success, 0 for error. */ + Status: string; + /** @description A timestamp value as sent in the request. */ + ts: string; + /** @description Transaction id value as sent in the request. */ + txn: string; + }; + /** @description Issuer can add meta content specific to document here. */ + DocDetails: { + /** @description Enclose the Base64 byte encoded contents of PDF file in this element. The DocContent element should be sent only if the format attribute in the original request is sent as “pdf” or “both” or is absent. */ + DocContent: string; + /** @description Enclose the Base64 byte encoded certificate metadata in XML format. The DataContent element should be sent only if the original request contains format attribute as “xml” or “both”. */ + DataContent: string; + }; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +} + +export type external = Record; + +export interface operations { + + /** + * Pull URI Request API . + * @description The Pull URI Request API has to be implemented by the issuers and will be consumed by Digital Locker application. This API will be invoked when a citizen searches the issuer repository for his/her certificate. If the certificate data is Aadhaar seeded, the issuer may choose to use Aadhaar number as the search parameter. Digital Locker provides Aadhaar number, name and date of birth as on Aadhaar to the issuer API as additional parameters. The option for these Aadhaar based parameters can be selected while configuring this API in Digital Locker Partner’s Portal. If the certificate data is not Aadhaar seeded then the issuer may use any other unique parameter e.g. driving license number to search for a driving license. These custom parameters will be passed in the UDF elements as shown in the sample request below. The custom parameter(s) can be configured while configuring the API in the DigiLocker Partner’s Portal. The Digital Locker system will query the issuer repository to fetch the URI for any document that match the search criteria. The citizen can save this URI in his/her Digital Locker. It is strongly recommended that the issuer API validate that the name, date of birth details sent by DigiLocker in Aadhaar parameters match with the corresponding details on the certificate before returning the certificate data. This will ensure that only authentic owners get access to a certificate. + */ + "Pull Uri": { + parameters: { + header?: { + /** @description application/xml */ + "Content-Type"?: string; + /** @description This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. */ + "x-digilocker-hmac"?: string; + }; + }; + requestBody?: { + content: { + "application/xml": components["schemas"]["PullURIRequest"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/xml": components["schemas"]["PullURIResponse"]; + }; + }; + }; + }; + /** + * Pull Doc Request API. + * @description The Pull Doc Request API has to be implemented by the issuers and will be consumed by Digital Locker system. This API will be invoked when the resident clicks on the URI displayed in the Issued documents section of DigLocker. The issuer API will by sending the certificate data. The certificate data should be sent in one of the two formats depending on the request send by Digital Locker:|- a. PDF document format b. XML format for machine readable metadata + */ + "Pull Doc": { + parameters: { + header?: { + /** @description application/xml */ + "Content-Type"?: string; + /** @description This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. */ + "x-digilocker-hmac"?: string; + }; + }; + requestBody?: { + content: { + "application/xml": components["schemas"]["PullDocRequest"]; + }; + }; + responses: { + /** @description successful operation */ + 200: { + content: { + "application/xml": components["schemas"]["PullDocResponse"]; + }; + }; + }; + }; +} diff --git a/src/impl/digilocker/spec/authpartner.yaml b/src/impl/digilocker/spec/authpartner.yaml new file mode 100644 index 0000000..1a5e4a4 --- /dev/null +++ b/src/impl/digilocker/spec/authpartner.yaml @@ -0,0 +1,3260 @@ +openapi: 3.0.2 +info: + title: Authorized Partner API Specification + description: >- + To access files in user’s DigiLocker account from your application, you must + first obtain user’s authorization. + termsOfService: 'https://ndh.digitallocker.gov.in/terms.php' + contact: + email: support@digitallocker.gov.in + version: 1.0.0 +servers: + - url: 'https://betaapi.digitallocker.gov.in/public' +tags: + - name: Authorization + description: Authorization APIs For Server Side Web Applications. + - name: Authorization API + description: Authorization APIs For Limited Input Devices. + - name: Token Revocation API + description: To revoke a previously obtained Token. + - name: Account Detail API + description: Get User Details + - name: File APIs + description: >- + File APIs allow your application to get the meta-data about issued and + uploaded documents in user’s DigiLocker. + - name: DigiLocker Sign up APIs + description: This API can be used to sign up a user for DigiLocker. + - name: DigiLocker Meta APIs + description: >- + DigiLocker Meta APIs provide information about a user account, issuers, + document types and parameters required to pull a document. +paths: + /oauth2/1/authorize: + get: + tags: + - Authorization + summary: Get Authorization Code + description: >- + Call to this API starts authorization flow using OAuth 2.0 protocol. + This isn't an API call—it's a DigiLocker web page that lets the user + sign in to DigiLocker and authorize your application to access user’s + data. After the user decides whether or not to authorize your app, they + will be redirected to the redirect link provided by your application. + operationId: Get Authorization Code id + parameters: + - name: client_id + in: query + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + schema: + type: string + - name: response_type + description: 'Provide the grant type requested, either token or code.' + in: query + required: true + schema: + type: string + - name: redirect_uri + description: The URI to redirect the user after authorization has completed. + in: query + required: true + schema: + type: string + - name: state + description: >- + This is your application specific data that will be passed back to + your application through redirect_uri. + in: query + required: true + schema: + type: string + - name: Code_challenge + description: | + A unique random string called code verifier (code_verifier) is + created by the client application for every authorization request. + The code_challenge sent as this parameter is the Base64URL (with no + padding) encoded SHA256 hash of the code verifier. + Code block: + + ``` + string base64_url_encode_without_padding(string arg) + { + string s = base64encode(arg); //Regular base64encoder with padding + s = s.replace(’=’,’’); //Remove any trailing ’=’ + s = s.replace(’+’, ’-’); //Replace ’+’ with ’-’ + s = s.replace(’/’, ’_’); //Replace ’/’ with ’_’ return s; + } + ``` + in: query + required: false + schema: + type: string + example: base64_url_encode_without_padding(sha256(code_verifier)) + properties: + parameter: + type: string + enum: + - Base64URL + - SHA256 + - name: Code_challenge_method + description: >- + Specifies what method was used to encode a code_verifier to generate + code_challenge parameter above. This parameter must be used with the + code_challenge parameter. The only supported values for this + parameter is S256. + in: query + required: false + schema: + type: string + properties: + parameter: + type: string + enum: + - S256 + - name: dl_flow + description: >- + If this parameter is provided its value will always be signup. This + parameter indicates that the user does not have a DigiLocker account + and will be directed to the signup flow directly. After the account + is created, the user will be directed to the authorization flow. If + this parameter is not sent, the user will be redirected to the sign + in flow. + in: query + required: false + schema: + type: string + - name: Verified_mobile + description: >- + Verified mobile number of the user. If this parameter is passed, + DigiLocker will skip the mobile OTP verification step during sign + up. DigiLocker will treat the mobile number passed in this parameter + as a verified mobile number by the trusted client application. This + parameter will be used only if dl_flow parameter mentioned above is + set to signup and will be ignored otherwise. + in: query + required: false + schema: + type: integer + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + details: + type: object + required: + - access_token + - expires_in + - token_type + - scope + properties: + access_token: + type: string + expires_in: + type: integer + token_type: + type: string + scope: + type: string + '400': + description: Invalid status value + security: + - oauthAuthorizeCode: [] + /oauth2/1/token: + post: + tags: + - Authorization + summary: Get Access Token + description: >- + This endpoint only applies to apps using the authorization code flow. An + app calls this endpoint to acquire a bearer token once the user has + authorized the app. Calls to /oauth2/1/token need to be authenticated + using the app's key and secret. These can either be passed as + application/x-www-form-urlencoded POST parameters (see parameters below) + or via HTTP basic authentication. If basic authentication is used, the + app key should be provided as the username, and the app secret should be + provided as the password. + operationId: getaccesstoken id + requestBody: + description: Details of documents being created. + required: true + content: + application/json: + schema: + type: object + properties: + Get access token using authorization code: + $ref: '#/components/schemas/AccessToken' + Get access token using refresh token: + $ref: '#/components/schemas/RefreshToken' + Get access token using device code and OTP: + $ref: '#/components/schemas/DeviceAccessToken' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/AccessResponse' + '400': + description: Bad request + '401': + description: >- + If the access token is expired or has been revoked by DigiLocker + user. + /oauth2/1/code: + post: + tags: + - Authorization API + summary: Get Device Code + description: >- + The client device calls the DigiLocker API to get the device code by + providing the client_id issued to the device OEM and either the username + or the mobile number of the user. DigiLocker responds with a device code + and then sends an OTP on the mobile number and email address associated + with the user’s account. The masked mobile number and email address is + also sent in response. The device should use these values to notify the + users about the mobile and email address on which the OTP has been sent. + operationId: Get Device Code id + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceAuthorizationCode' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DeviceAuthorizationCodeResponse' + '400': + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ResponseOne' + - $ref: '#/components/schemas/ResponseTwo' + - $ref: '#/components/schemas/ResponseThree' + - $ref: '#/components/schemas/ResponseFour' + '401': + description: The client_id parameter is invalid. + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ResponseFive' + - $ref: '#/components/schemas/ResponseSix' + security: + - oauthsecurity: [] + /oauth2/1/revoke: + post: + tags: + - Token Revocation API + summary: Revoke Token. + description: >- + Client applications can revoke a previously obtained refresh or access + token when it is no longer needed. This is done by making a request to + the token revocation endpoint. DigiLocker will invalidate the specified + token and, if applicable, other tokens based on the same authorisation + grant. This API may be used to sign out a user from DigiLocker. This API + will work for server based web applications, mobile application and + limited input devices. + operationId: get token revocation id + requestBody: + content: + application/json: + schema: + required: + - token + type: object + properties: + token: + type: string + description: The token that needs to be revoked. + token_type_hint: + type: string + enum: + - refresh_token + - access_token + description: >- + The type of the above token. The value will be one of + access_token or refresh_token. If this parameter is not + sent, DigiLocker will look for this token in both access and + refresh tokens and then revoke it. + responses: + '200': + description: successful operation + '400': + description: The token is invalid + security: + - oauthsecurity: [] + /oauth2/1/user: + get: + tags: + - Account Detail API + summary: Get User Details + description: >- + Client applications can call this API to get the DigiLocker Id, name, + date of birth and gender of the account holder. An access token is + required to call this API. The API will return the user details of the + account with which the access token is linked. It is strongly + recommended that the API can be called by client application only once + after acquiring the access token. Since the user details do not change, + the client application may store the values and use them when necessary + than calling this API repeatedly. + operationId: Account Detail API id + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + details: + type: object + required: + - digilockerid + - name + - dob + - gender + - eaadhaar + properties: + digilockerid: + type: string + example: 123e4567-e89b-12d3-a456-426655440000 + description: >- + A unique 36 character DigiLocker Id of the user + account. + name: + type: string + example: Sunil Kumar + description: The name of the user as registered with DigiLocker. + eaadhar: + type: string + enum: + - 'Y' + - 'N' + description: >- + This indicates whether eAadhaar data is available for + this account. Possible values are Y and N. + dob: + type: string + format: dd-mm-yyy + example: '31121970' + description: >- + This is date of birth of the user as registered with + DigiLocker in DDMMYYYY format. + gender: + type: string + enum: + - M + - F + - T + description: >- + This is gender of the user as registered with + DigiLocker. The possible values are M, F, T for male, + female and transgender respectively. + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '500': + description: Internal server error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: unexpected_error + error_description: + type: string + example: Internal server error + security: + - bearerAuth: [] + /oauth2/1/files/: + get: + tags: + - File APIs + summary: Get List of Self Uploaded Documents + description: >- + Returns the list of meta-data about documents or folders in user’s + DigiLocker in a specific location. + operationId: Get List of Self Uploaded Documents + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + directory: + type: string + minLength: 1 + items: + type: array + uniqueItems: true + minItems: 1 + items: + required: + - id + - name + - type + - size + - date + - parent + - mime + - uri + - description + - issuer + properties: + id: + type: string + minLength: 1 + example: 189079894 + name: + type: string + minLength: 1 + type: + type: string + minLength: 1 + size: + type: string + minLength: 1 + date: + type: string + minLength: 1 + parent: + type: string + minLength: 1 + mime: + type: string + uri: + type: string + description: + type: string + issuer: + type: string + required: + - directory + - items + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_id + error_description: + type: string + example: The folder does not exist + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: unexpected_error + error_description: + type: string + example: Internal server error + security: + - bearerAuth: [] + '/oauth2/1/files/{id}': + get: + tags: + - File APIs + summary: Get List of Self Uploaded Documents + description: >- + Returns the list of meta-data about documents or folders in user’s + DigiLocker in a specific location. + operationId: Get List of Self Uploaded Documents id + parameters: + - name: id + in: path + description: >- + The id of the folder to list. To list the files of root folder of a + user’s locker, do not send this parameter. This is sent as a part of + the URL. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + details: + type: object + required: + - type + - name + - id + - size + - date + - parent + - mime + - uri + - description + - issuer + properties: + name: + type: string + example: My Documents + description: The name of the file or folder. + type: + type: string + example: dir + description: String dir for folder and string file for file. + id: + type: integer + example: '5678' + description: The id if this item is a folder. + size: + type: string + example: '366481' + description: Size of file or folder. + date: + type: string + example: '2015-05-12T15:50:38Z' + description: >- + This contains the date of file upload in case of self + uploaded documents + parent: + type: string + example: '1234' + description: The id of the parent folder. + mime: + type: string + example: '' + description: >- + The mime type of the file. This field will contain + “application/PDF” for PDF files; “image/png” for PNG + files and “image/jpg” or “image/jpeg” for JPG/JPEG + files. This will be blank in case of folder. + uri: + type: string + example: '' + description: >- + This is the unique identifier of the document shared + by the user in DigiLocker. You will use this + identifier to get the actual file from DigiLocker + using the API. URI will be blank in case of folder. + description: + type: string + example: '' + description: >- + This is the descriptive document type stored in + DigiLocker such as ‘Income Certificate’ or ‘Driving + License’. + issuer: + type: string + example: '' + description: >- + The name of the issuer. This is blank in case of + uploaded documents and folders. + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_id + error_description: + type: string + example: The folder does not exist + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: unexpected_error + error_description: + type: string + example: Internal server error + security: + - bearerAuth: [] + /oauth2/2/files/issued: + get: + tags: + - File APIs + summary: Issued Documents + description: >- + Returns the list of meta-data about issued documents in user’s + DigiLocker. + operationId: Get List of issued Documents id + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + properties: + items: + type: array + uniqueItems: true + minItems: 1 + items: + required: + - name + - type + - size + - date + - parent + - uri + - doctype + - description + - issuerid + - issuer + properties: + name: + type: string + minLength: 1 + type: + type: string + minLength: 1 + size: + type: string + date: + type: string + minLength: 1 + parent: + type: string + mime: + type: array + items: + properties: {} + uri: + type: string + minLength: 1 + doctype: + type: string + minLength: 1 + description: + type: string + minLength: 1 + issuerid: + type: string + minLength: 1 + issuer: + type: string + minLength: 1 + resource: + type: string + minLength: 1 + required: + - items + - resource + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ResponseSix' + - $ref: '#/components/schemas/ResponseSeven' + /oauth2/1/files/issued: + get: + tags: + - File APIs + summary: Issued Documents + description: >- + Returns the list of meta-data about issued documents in user’s + DigiLocker. + operationId: Get List of issued Documents Version1 id + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + details: + type: object + required: + - type + - name + - size + - date + - parent + - mime + - uri + - doctype + - description + - issuer + - issuerid + properties: + name: + type: string + example: Class XII Marksheet + description: The name of the certificate. + type: + type: string + example: file + description: String file. + size: + type: string + example: ' ' + description: This will be blank. + date: + type: string + example: '2015-05-12T15:50:38Z' + description: >- + This contains the date on which the certificate was + last modified in DigiLocker. + parent: + type: string + example: ' ' + description: This will be blank. + mime: + type: string + example: application/pdf + description: >- + The list of mime types for the certificate data. This + field will contain “application/PDF” or + “application/xml”. + uri: + type: string + example: in.gov.cbse-HSCER-201412345678 + description: >- + This is the unique identifier of the document shared + by the user in DigiLocker. You will use this + identifier to get the actual file from DigiLocker + using the API. + doctype: + type: string + example: HSCER + description: >- + A 5 character unique document type provided by + DigiLocker. + description: + type: string + example: Class XII Marksheet + description: >- + This is the descriptive document type stored in + DigiLocker such as ‘Income Certificate’ or ‘Driving + License’. + issuer: + type: string + example: CBSE + description: The name of the issuer. + issuerid: + type: string + example: in.gov.cbse + description: Unique DigiLocker issuer id as mentioned in the URI. + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ResponseSix' + - $ref: '#/components/schemas/ResponseSeven' + security: + - bearerAuth: [] + '/oauth2/1/file/{uri}': + get: + tags: + - File APIs + summary: Get File from URI + description: >- + Returns a file from URI. This API can be used to fetch both issued + document and uploaded document. + operationId: Get File from URI id + parameters: + - name: uri + in: path + description: This is the unique identifier of the document. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/pdf: + schema: + type: string + example: pdf binary content + image/jpg: + schema: + type: string + example: jpg binary content + image/jpeg: + schema: + type: string + example: jpeg binary content + image/png: + schema: + type: string + example: png binary content + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: uri_missing + error_description: + type: string + example: URI parameter missing + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_uri + error_description: + type: string + example: No file found for given URI + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response3' + - $ref: '#/components/schemas/Response4' + - $ref: '#/components/schemas/Response5' + - $ref: '#/components/schemas/Response6' + '503': + description: Gateway timeout + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response1' + - $ref: '#/components/schemas/Response2' + security: + - bearerAuth: [] + '/oauth2/1/xml/{uri}': + get: + tags: + - File APIs + summary: Get Certificate Data in XML Format from URI + description: >- + Returns the certificate data in machine readable XML format for a URI. + This API can be used to only for issued documents. The XML data may not + be available for all documents. If the XML data is available for a + particular document, the mime parameter in Get List of Issued Documents + API will contain application/xml. Please refer to Digital Locker XML + Certificate Formats for more details of XML formats of various + documents. + operationId: Get Certificate Data in XML Format from URI id + parameters: + - name: uri + in: path + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/XMLFormatSchema' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: uri_missing + error_description: + type: string + example: URI parameter missing + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_uri + error_description: + type: string + example: No file found for given URI + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response3' + - $ref: '#/components/schemas/Response4' + - $ref: '#/components/schemas/Response5' + - $ref: '#/components/schemas/Response6' + '503': + description: Gateway timeout + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response1' + - $ref: '#/components/schemas/Response2' + security: + - bearerAuth: [] + /oauth2/2/xml/eaadhaar: + get: + tags: + - File APIs + summary: Get e-Aadhaar Data in XML Format + description: Returns e-Aadhaar data in XML format for the account. + operationId: Get e-Aadhaar Data in XML Format id + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/EaadharXamlSchema' + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + enum: + - aadhaar_not_linked + - aadhaar_not_available + error_description: + enum: + - Aadhaar is not linked to the account + - >- + Aadhaar data is not available for this user. Please + perform Aadhaar eKYC again. + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response3' + - $ref: '#/components/schemas/Response4' + - $ref: '#/components/schemas/Response5' + - $ref: '#/components/schemas/Response6' + '503': + description: Gateway timeout + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response1' + - $ref: '#/components/schemas/Response2' + security: + - bearerAuth: [] + /oauth2/1/file/upload: + post: + tags: + - File APIs + summary: Upload file to locker + description: >- + This API can be used to save/upload a file to uploaded documents in + DigiLocker. The allowed file types are JPG, JPEG, PNG and PDF. The file + size must not exceed 10MB. + operationId: Upload File to Locker id + parameters: + - name: path + description: The destination path of the file in DigiLocker including filename. + in: header + required: false + schema: + type: string + - name: hmac + description: >- + This is used to verify the integrity of the file data. The client + app calculates the hash message authentication code (HMAC) of the + file content using SHA256 hashing algorithm and the client secret as + the hashing key. The resulting HMAC is converted to Base64 format + and sent in this parameter. Upon upload of file, DigiLocker + calculates the HMAC of the file data and compares it with this + HMAC.. + in: header + required: false + schema: + type: string + requestBody: + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/FileUpload' + image/png: + schema: + type: string + format: binary + image/jpeg: + schema: + type: string + format: binary + image/jpg: + schema: + type: string + format: binary + image/pdf: + schema: + type: string + format: binary + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/FileUploadResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + enum: + - path_missing + - contenttype_missing + - hmac_missing + - filename_missing + - hmac_mismatch + - invalid_filename + - invalid_filesize + - invalid_filetype + - invalid_path + - file_data_missing + - mimetype_mismatch + error_description: + enum: + - Path parameter is missing + - Content-Type parameter is missing + - HMAC parameter is missing + - Filename is missing in path parameter + - HMAC does not match + - Restricted characters are not allowed in file name + - The file size exceeds maximum allowed file size of 10MB + - The file type is not allowed + - The destination folder does not exist + - Missing file content in the request + - >- + The mimetype provided in Content-Type parameter does not + match with the mimetype of the file + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: unexpected_error + error_description: + type: string + description: Internal server error + security: + - bearerAuth: [] + /oauth2/1/pull/pulldocument: + post: + tags: + - File APIs + summary: Pull Document + description: >- + This API allows a client application to search a document/certificate + from issuer’s repository using the parameters provided by a user. The + searched document is saved in user’s issued document section of + DigiLocker if the search is successful. + operationId: Pull Document id + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PullDocumentSchema' + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + properties: + details: + type: object + required: + - uri + properties: + uri: + type: string + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response13' + - $ref: '#/components/schemas/ResponseSix' + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_token + error_description: + type: string + example: The access token is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + description: record_not_found + error_description: + description: + No record found in issuer database for given criteria. + Please check the details and try again. If problem + persists, see the FAQ section for possible causes. + '500': + description: Internal Error + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response14' + - $ref: '#/components/schemas/Response15' + - $ref: '#/components/schemas/Response16' + - $ref: '#/components/schemas/Response17' + - $ref: '#/components/schemas/Response18' + security: + - bearerAuth: [] + /signup/2/demoauth: + post: + tags: + - DigiLocker Sign up APIs + summary: SIGN UP + description: >- + This API is used to validate Aadhaar details and verify the mobile + number by generating an OTP. This API call, if successful, will be + followed by verify OTP call by the partner application if the user is + online or available to perform OTP validation as indicated in + verification parameter + operationId: SIGN UP id + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/DemoAuth' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DemoAuthResponse' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response10' + - $ref: '#/components/schemas/Response11' + - $ref: '#/components/schemas/Response12' + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /signup/1/demoauthverify: + post: + tags: + - DigiLocker Sign up APIs + summary: Verify OTP + description: >- + This API is used to verify the OTP sent by DigiLocker during the sign up + API call above. + operationId: Verify OTP id + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/DemoAuthVerify' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DemoAuthVerifyResponse' + '400': + description: Bad request + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/Response7' + - $ref: '#/components/schemas/Response8' + - $ref: '#/components/schemas/Response9' + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /oauth2/1/pull/issuers: + post: + tags: + - DigiLocker Meta APIs + summary: Get List of Issuers + description: Returns the list of issuers registered with DigiLocker. + operationId: Get List of Issuers id + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/Issuer' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/IssuerResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_parameter + error_description: + type: string + example: One or more of the mandatory parameters is missing or + invalid. The error description text will contain one or + more of the following error texts:|- +  Timestamp parameter + is missing or invalid  HMAC parameter is missing or + invalid + + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /oauth2/1/pull/doctype: + post: + tags: + - DigiLocker Meta APIs + summary: Get List of Documents Provided by an Issuer + description: >- + Returns a list of documents/certificates issued by an issuer + organization registered with DigiLocker. + operationId: Get List of Documents Provided by an Issuer id + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/DocType' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/DocTypeResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + description: invalid_parameter + error_description: + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  The orgid parameter is missing or invalid  + Timestamp parameter is missing or invalid  HMAC + parameter is missing or invalid + + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /oauth2/1/pull/parameters: + post: + tags: + - DigiLocker Meta APIs + summary: Get Search Parameters for a Document + description: >- + Returns a list of parameters required to search a document/certificate + of an issuer organization registered with DigiLocker. These parameters + are used to pull a document from issuer’s repository using Pull Document + API mentioned in subsequent section. + operationId: Get Search Parameters for a Document id + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/SearchParameters' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/SearchParametersResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + description: invalid_parameter + error_description: + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  The orgid parameter is missing or invalid  The + doctype parameter is missing or invalid  Timestamp + parameter is missing or invalid  HMAC parameter is + missing or invalid + + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: invalid_client_id + error_description: + type: string + example: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /account/2/verify: + post: + tags: + - DigiLocker Meta APIs + summary: Verify Account + description: >- + This API can be used to verify whether a mobile number or Aadhaar number + is already registered with DigiLocker. + operationId: Verify Account id + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/VerifyAccount' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyAccountResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + description: invalid_parameter + error_description: + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  Either one of uid or mobile number is mandatory  + Timestamp parameter is missing or invalid  HMAC + parameter is missing or invalid + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_client_id + error_description: + type: string + description: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + description: unexpected_error + error_description: + description: Internal server error + security: + - oauthsecurity: [] + /account/1/pushuri: + post: + tags: + - DigiLocker Meta APIs + summary: Push URI to Account + description: >- + The API can use to push or delete a single URI into Digital Locker using + DigiLocker Id acquired using Get User Details API. This API can be used + to push the certificate details to Digital Locker as and when a + certificate is generated in the issuer system. The issuing departments + must register on DigiLocker as a registered Issuer and implement the + requisite Issuer APIs as mentioned in Digital Locker Issuer API + Specification document prior to pushing certificates using this API. + operationId: Push URI to Account id + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/PushUri' + responses: + '200': + description: successful operation + content: + application/json: + schema: + title: Sample + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_parameter + error_description: + type: string + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  URI parameter is missing or invalid +  Doctype parameter is missing or invalid +  Description parameter is missing or invalid +  Docid parameter is missing or invalid  Issuedate parameter is missing orinvalid  Timestamp parameter is missing or invalid  + HMAC parameter is missing or invalid  URI already + exists in this account  URI already exists in + another account + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_client_id + error_description: + type: string + description: The client_id parameter is invalid + '404': + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_digilocker_id + error_description: + type: string + description: The digilockerid parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: unexpected_error + error_description: + type: string + description: Internal server error + security: + - oauthsecurity: [] + /statistics/1/counts: + post: + tags: + - DigiLocker Meta APIs + summary: Get Statistics + description: >- + Returns DigiLocker statistics such as the count of users, authentic + documents, issuers and requesters as on a specific date. + operationId: Get Statistics id + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/GetStatistics' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/GetStatisticsResponse' + '400': + description: Bad request + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_parameter + error_description: + type: string + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  Timestamp parameter is missing or invalid +  HMAC parameter is missing or invalid + '401': + description: Unauthorized error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: invalid_client_id + error_description: + type: string + description: The client_id parameter is invalid + '500': + description: Internal Error + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: unexpected_error + error_description: + type: string + description: Internal server error + security: + - oauthsecurity: [] +components: + schemas: + AccessToken: + required: + - grant_type + - client_id + - client_secret + type: object + properties: + grant_type: + type: string + enum: + - authorization_code + code: + type: string + example: ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 + redirect_uri: + type: string + example: 'https://ndh.digitallocker.gov.in/oauth2-redirect.html' + code_verifier: + type: string + example: a123456abca + client_id: + type: string + example: ABCDEFG + client_secret: + type: string + example: a123456abcdeghijk7890 + AccessResponse: + required: + - access_token + - expires_in + - token_type + - scope + - refresh_token + - digilocker_id + - name + - dob + - gender + - eaadhar + - reference_key + type: object + properties: + access_token: + type: string + example: bc125c212a4b03a9a188a858be5a163f379e878a + description: The access token that can be used to call the DigiLocker APIs. + expires_in: + type: integer + format: int64 + example: 3600 + description: The duration in seconds for which the access token is valid + token_type: + type: string + example: Bearer + description: The type of token which will always be Bearer. + scope: + type: string + description: Scope of the token. + refresh_token: + type: string + example: a47ab18c593703e4f83a274694db7422a8cfcb8f + description: >- + The refresh token used to refresh the above access token when it + expires. Please refer to Refresh Access Token API for more details. + digilocker_id: + type: string + example: 123e4567-e89b-12d3-a456-426655440000 + description: A unique 36 character DigiLocker Id of the user account. + name: + type: string + example: Sunil Kumar + description: The name of the user as registered with DigiLocker. + eaadhar: + type: string + enum: + - 'Y' + - 'N' + description: >- + This indicates whether eAadhaar data is available for this account. + Possible values are Y and N. + dob: + type: integer + format: dd-mm-yyy + example: '31121970' + description: >- + This is date of birth of the user as registered with DigiLocker in + DDMMYYYY format. + gender: + type: string + enum: + - M + - F + - T + description: >- + This is gender of the user as registered with DigiLocker. The + possible values are M, F, T for male, female and transgender + respectively. + reference_key: + type: string + example: 1c66bec26364cd6fefaabc6cae91840a + description: A unique reference of the user account. + RefreshToken: + required: + - grant_type + - refresh_token + - client_id + - client_secret + type: object + properties: + grant_type: + type: string + enum: + - refresh_token + refresh_token: + type: string + example: ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 + client_id: + type: string + example: ABCDEFG + client_secret: + type: string + example: a123456abcdeghijk7890 + RefreshAccessToken: + required: + - grant_type + - refresh_Token + type: object + properties: + grant_type: + type: string + example: refresh_token + refresh_Token: + type: string + example: a47ab18c593703e4f83a274694db7422a8cfcb8f + DeviceAuthorizationCode: + properties: + client_id: + type: string + response_type: + type: string + description: The parameter must be set to device_code. + example: device_code + dl_mobile: + type: integer + description: |- + Mobile number associated with DigiLocker account of the + user. The client device accepts the mobile number on the device from user and sends it in this parameter. Either the username or the mobile number must be provided. + dl_username: + description: >- + DigiLocker username of the user. The client device accepts the + username on the device from user and sends the username in this + parameter. Either the username or the mobile number must be + provided. + type: string + DeviceAuthorizationCodeResponse: + required: + - device_code + - dl_masked_mobile + - dl_masked_email + - expires_in + type: object + properties: + device_code: + type: string + example: 74tq5miHKB + description: The device verification code. + dl_masked_mobile: + type: integer + example: XXXXXX1234 + description: The masked mobile number on which the OTP is sent. + dl_masked_email: + type: string + example: xxxxxx@gmail.com + description: The masked email on which the OTP is sent. + expires_in: + type: integer + example: 600 + description: The duration in seconds for which the code is valid. + DeviceAccessToken: + properties: + client_id: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + grant_type: + description: >- + The grant type, which must be + “urn:ietf:params:oauth:grant-type:device_code”. + type: string + example: 'urn:ietf:params:oauth:grant-type:device_code' + device_code: + description: >- + The device verification code. The device_code field from Get Device + Code Response. + type: string + dl_otp: + description: The OTP collected from the user + type: string + AuthTokenResponse: + required: + - access_token + - expires_in + - token_type + - scope + - refresh_token + type: object + properties: + access_token: + type: string + example: bc125c212a4b03a9a188a858be5a163f379e878a + description: |- + The access token that can be used to call the + DigiLocker APIs. + expires_in: + type: integer + format: int64 + example: 3600 + description: |- + The duration in seconds for which the access token is + valid. + token_type: + type: string + example: Bearer + description: The type of token which will always be Bearer. + scope: + type: string + description: Scope of the token. + refresh_token: + type: string + example: ad6f4004cc3e53f56bda391fe485fc4d32928061 + description: |- + The refresh token used to refresh the above access + token when it expires. This will value will be + returned only in case of web applications and not be + returned for limited input devices. + FileUpload: + properties: + Content-Type: + type: string + description: >- + The mime type of the file e.g. image/jpg, image/jpeg, image/png, + application/pdf. + FileUploadResponse: + properties: + details: + required: + - Path + - size + type: object + properties: + Path: + type: string + description: >- + The destination path of the file in DigiLocker including + filename. + size: + type: string + description: Size of file. + DemoAuth: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + mobile: + description: >- + This is the mobile number of the user. DigiLocker will check whether + an account exists for this mobile number. Either uid or mobile is + required to verify whether an account exists. + type: integer + name: + description: This is name of the user as mentioned in Aadhaar. + type: string + dob: + description: >- + This is date of birth of the user as mentioned in Aadhaar in + DDMMYYYY format. + type: integer + gender: + description: >- + This is gender of the user as mentioned in Aadhaar. The possible + values are M, F, T for male, female and transgender respectively. + enum: + - M + - F + - T + verification: + description: >- + The parameter indicates whether the mobile number provided above + should be validated by DigiLocker. If this parameter is ‘Y’, the + DigiLocker sends an OTP to verify the mobile number. In this case + the client application will call the second API to validate the OTP. + The user will be signed on only after successful OTP validation. + This flow should be used when the user account is created by user + himself/herself or the user is present to provide the OTP. If this + parameter is ‘N’, the user account will be created without OTP + validation. The OTP validation will be performed when the user signs + in for the first time in DigiLocker. This flow should be used when + the user account needs to be created in the absence of the user. + type: string + consent: + description: >- + The consent indicator from the user for performing demographic + authentication using Aadhaar details. This Partner Application must + capture the user consent for performing the Aadhaar demographic + authentication. The possible values are ‘Y’ and ‘N’. The sign up + request will be processed only when this indicator is ‘Y’. + type: string + demoauth: + description: >- + The parameter indicates whether Aadhaar demographic authentication + must be successful for creating DigiLocker account. The possible + values are ‘Y’ and ‘N’. The value of ‘Y’ will perform Aadhaar + demographic authentication and will return errors if any in + response. The value of ‘N’ will also perform Aadhaar demographic + authentication but will return any error in case of authentication + failure. It will create a basic mobile based account for the user. + Value ‘N’ should be used when the user account needs to be created + in the absence of the user. + type: string + uid: + description: >- + This is the Aadhaar number of the user. DigiLocker will check + whether an account exists for this Aadhaar number. Either uid or + mobile is required to verify whether an account exists. + type: integer + DemoAuthResponse: + properties: + details: + type: object + required: + - access_token + - expires_in + - token_type + - scope + - refresh_token + - mobile + properties: + access_token: + type: string + example: bc125c212a4b03a9a188a858be5a163f379e878a + description: The access token that can be used to call the DigiLocker APIs. + expires_in: + type: string + example: 3600 + description: The duration in seconds for which the access token is valid. + token_type: + type: string + example: Bearer + description: The type of token which will always be Bearer. + scope: + type: string + example: '' + description: Scope of the token + refresh_token: + type: string + example: a47ab18c593703e4f83a274694db7422a8cfcb8f + description: >- + The refresh token used to refresh the above access token when it + expires. Please refer to Refresh Access Token API for more + details. + mobile: + type: integer + example: '******3712' + description: >- + The masked mobile number of the user on which the OTP has been + sent. + DemoAuthVerify: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + mobile: + description: >- + This is the mobile number of the user. DigiLocker will check whether + an account exists for this mobile number. Either uid or mobile is + required to verify whether an account exists. + type: integer + otp: + description: The OTP provided by the user. + type: integer + DemoAuthVerifyResponse: + properties: + details: + type: object + required: + - access_token + - expires_in + - token_type + - scope + - refresh_token + properties: + access_token: + type: string + example: bc125c212a4b03a9a188a858be5a163f379e878a + description: The access token that can be used to call the DigiLocker APIs. + expires_in: + type: string + example: 3600 + description: The duration in seconds for which the access token is valid. + token_type: + type: string + example: Bearer + description: The type of token which will always be Bearer. + scope: + type: string + example: '' + description: Scope of the token + refresh_token: + type: string + example: a47ab18c593703e4f83a274694db7422a8cfcb8f + description: >- + The refresh token used to refresh the above access token when it + expires. Please refer to Refresh Access Token API for more + details. + IssuerResponse: + type: object + properties: + issuers: + type: array + uniqueItems: true + minItems: 1 + items: + required: + - name + - description + - categories + - issuerid + - orgid + properties: + name: + type: string + minLength: 1 + description: + type: string + categories: + type: string + minLength: 1 + issuerid: + type: string + minLength: 1 + orgid: + type: string + minLength: 1 + required: + - issuers + Issuer: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + DocType: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + orgid: + description: >- + The organization id for the issuer in DigiLocker. This organization + id is returned in Get List of Issuers API mentioned earlier. + type: string + DocTypeResponse: + type: object + properties: + documents: + type: array + uniqueItems: true + minItems: 1 + items: + required: + - doctype + - description + properties: + doctype: + type: string + minLength: 1 + description: + type: string + minLength: 1 + required: + - documents + SearchParameters: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + orgid: + description: >- + The organization id for the issuer in DigiLocker. This organization + id is returned in Get List of Issuers API mentioned earlier. + type: string + doctype: + description: A 5 character unique document type provided by DigiLocker. + type: string + SearchParametersResponse: + type: array + minItems: 1 + uniqueItems: true + items: + type: object + required: + - label + - paramname + - example + properties: + label: + type: string + minLength: 1 + paramname: + type: string + minLength: 1 + valuelist: {} + example: + type: string + minLength: 1 + VerifyAccount: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + mobile: + description: >- + This is the mobile number of the user. DigiLocker will check whether + an account exists for this mobile number. Either uid or mobile is + required to verify whether an account exists. + type: integer + uid: + description: >- + This is the Aadhaar number of the user. DigiLocker will check + whether an account exists for this Aadhaar number. Either uid or + mobile is required to verify whether an account exists. + type: integer + VerifyAccountResponse: + type: object + required: + - registered + - digilockerid + properties: + registered: + type: string + example: 'true' + description: >- + true indicates that the provided Aadhaar/mobile number is already + registered and false indicates otherwise. + digilockerid: + type: string + example: 123e4567-e89b-12d3-a456-426655440000 + description: A unique 36 character DigiLocker Id of the user account. + PushUri: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + docid: + description: >- + A unique number of the document. This id will be unique within the + document type issued by the issuer. + type: string + uri: + description: This is the unique identifier of the document. + type: string + digilockerid: + description: >- + This is the DigiLocker Id of the user that was acquired using Get + User Details API. + type: integer + issuedate: + description: The issue date of the document in DDMMYYYY format. + type: string + validfrom: + description: >- + The date from which the document is valid in DDMMYYYY format. This + may be same as the issue date. + type: integer + validto: + description: The expiry date of the document in DDMMYYYY format. + type: string + action: + description: >- + Action that needs to be taken for the Aadhaar number and URI + combination. Possible values are A for adding a new URI, U for + updating an already added URI details or D for deleting the URI. + type: string + GetStatistics: + properties: + clientid: + type: string + description: >- + Provide the client id that was created during the application + registration process on Partners Portal. + hmac: + type: string + description: >- + Provide SHA-256 encrypted value of the client secret, clientid and + ts parameters above concatenated in this sequence (client secret, + clientid, ts). The hmac parameter is used by DigiLocker to ensure + the data integrity and authentication of the request. Use the Client + Secret Key generated during the application registration process on + Partners Portal as the client secret. + format: binary + ts: + type: string + description: >- + Provide a timestamp value in UNIX (or POSIX) format in IST time zone + in seconds. This timestamp value must not be older than 30 minutes. + GetStatisticsResponse: + type: object + required: + - users + - authentic_documents + - issuers + - requestors + - count_as_on + - monthwise_registations + - id + - month + - year + - count + - yearwise_authentic_documents + properties: + users: + type: string + example: '25873490' + description: Count of registered users on DigiLocker. + authentic_documents: + type: string + example: '3520475277' + description: Count of authentic documents available through DigiLocker. + issuers: + type: string + example: '134' + description: Count of issuer organizations registered on DigiLocker. + requestors: + type: string + example: '45' + description: Count of requester organizations registered on DigiLocker. + count_as_on: + type: string + example: '31072019' + description: The date on which this statistics is generated. + monthwise_registations: + description: List of last 12 months cumulative user registrations + type: object + properties: + id: + type: integer + example: '18496' + description: Unique id of the list item. + month: + type: integer + example: '5' + description: Month of the year in numeric format with January as 1 + year: + type: integer + example: '2018' + description: Year in YYYY format + count: + type: integer + example: '124794' + description: Count of cumulative user registrations in the given month. + details2: + type: object + properties: + id: + type: integer + example: '18496' + description: Unique id of the list item. + month: + type: integer + example: '5' + description: Month of the year in numeric format with January as 1 + year: + type: integer + example: '2018' + description: Year in YYYY format + count: + type: integer + example: '124794' + description: Count of cumulative user registrations in the given month. + yearwise_authentic_documents: + description: >- + List of cumulative year-wise counts of authentic documents in + DigiLocker. + type: object + properties: + id: + type: integer + example: '18347' + description: Unique id of the list item. + year: + type: integer + example: '2016' + description: Year in YYYY format. + count: + type: integer + example: '10134567' + description: |- + Count of cumulative user authentic documents in + the given year. + details: + type: object + properties: + id: + type: integer + example: '18350' + description: Unique id of the list item. + year: + type: integer + example: '2017' + description: Year in YYYY format. + count: + type: integer + example: '1000548093' + description: >- + Count of cumulative user authentic documents in the given + year. + details1: + type: object + properties: + id: + type: integer + example: '18354' + description: Unique id of the list item. + year: + type: integer + example: '2018' + description: Year in YYYY format. + count: + type: integer + example: '2410543684' + description: >- + Count of cumulative user authentic documents in the given + year. + details2: + type: object + properties: + id: + type: integer + example: '18567' + description: Unique id of the list item. + year: + type: integer + example: '2019' + description: Year in YYYY format. + count: + type: integer + example: '3520475277' + description: >- + Count of cumulative user authentic documents in the given + year. + XMLFormatSchema: + type: object + properties: + CertificateData: + type: array + items: + properties: {} + Signature: + type: object + properties: + SignedInfo: {} + SignatureValue: {} + KeyInfo: + type: object + properties: + X509Data: {} + required: + - KeyInfo + required: + - CertificateData + - Signature + EaadharXamlSchema: + type: object + properties: + KycRes: + type: object + properties: + Rar: + type: string + minLength: 1 + UidData: + type: object + properties: + Poi: + type: object + properties: + dob: + type: string + minLength: 1 + gender: + type: string + minLength: 1 + name: + type: string + minLength: 1 + required: + - dob + - gender + - name + Poa: + type: object + properties: + co: + type: string + minLength: 1 + country: + type: string + minLength: 1 + dist: + type: string + minLength: 1 + lm: + type: string + minLength: 1 + loc: + type: string + minLength: 1 + pc: + type: string + minLength: 1 + state: + type: string + minLength: 1 + vtc: + type: string + minLength: 1 + required: + - co + - country + - dist + - lm + - loc + - pc + - state + - vtc + LData: + type: object + properties: + co: + type: string + minLength: 1 + country: + type: string + minLength: 1 + dist: + type: string + minLength: 1 + lang: + type: string + minLength: 1 + lm: + type: string + minLength: 1 + loc: + type: string + minLength: 1 + name: + type: string + minLength: 1 + pc: + type: string + minLength: 1 + state: + type: string + minLength: 1 + vtc: + type: string + minLength: 1 + required: + - co + - country + - dist + - lang + - lm + - loc + - name + - pc + - state + - vtc + Pht: + type: string + minLength: 1 + Prn: + type: object + properties: + type: + type: string + minLength: 1 + text: + type: string + minLength: 1 + required: + - type + - text + tkn: + type: string + minLength: 1 + uid: + type: string + minLength: 1 + required: + - Poi + - Poa + - LData + - Pht + - Prn + - tkn + - uid + Signature: + type: object + properties: + SignedInfo: + type: object + properties: + CanonicalizationMethod: + type: object + properties: + Algorithm: + type: string + minLength: 1 + required: + - Algorithm + SignatureMethod: + type: object + properties: + Algorithm: + type: string + minLength: 1 + required: + - Algorithm + Reference: + type: object + properties: + Transforms: + type: object + properties: + Transform: + type: object + properties: + Algorithm: + type: string + minLength: 1 + required: + - Algorithm + required: + - Transform + DigestMethod: + type: object + properties: + Algorithm: + type: string + minLength: 1 + required: + - Algorithm + DigestValue: + type: string + minLength: 1 + URI: + type: string + required: + - Transforms + - DigestMethod + - DigestValue + - URI + required: + - CanonicalizationMethod + - SignatureMethod + - Reference + SignatureValue: + type: string + minLength: 1 + KeyInfo: + type: object + properties: + X509Data: + type: object + properties: + X509SubjectName: + type: string + minLength: 1 + X509Certificate: + type: string + minLength: 1 + required: + - X509SubjectName + - X509Certificate + required: + - X509Data + xmlns: + type: string + minLength: 1 + required: + - SignedInfo + - SignatureValue + - KeyInfo + - xmlns + code: + type: string + minLength: 1 + ret: + type: string + minLength: 1 + ts: + type: string + minLength: 1 + ttl: + type: string + minLength: 1 + txn: + type: string + minLength: 1 + required: + - Rar + - UidData + - Signature + - code + - ret + - ts + - ttl + - txn + required: + - KycRes + PullDocumentSchema: + properties: + orgid: + description: >- + The organization id for the issuer in DigiLocker. This organization + id is returned in Get List of Issuers API mentioned above. + type: string + doctype: + type: string + description: A 5 character unique document type provided by DigiLocker. + consent: + description: >- + The consent indicator from the user for performing demographic + authentication using Aadhaar details. This Partner Application must + capture the user consent for performing the Aadhaar demographic + authentication. The possible values are ‘Y’ and ‘N’. The sign up + request will be processed only when this indicator is ‘Y’. + type: string + reg_no: + type: string + description: >- + Other parameters required for fetching a document as listed in + paramname field of Get Search Parameters API. + chasis_no: + type: string + description: >- + Other parameters required for fetching a document as listed in + paramname field of Get Search Parameters API. + ResponseOne: + type: object + properties: + error: + type: string + description: invalid_response_type + error_description: + type: string + description: The response_type parameter is invalid + ResponseTwo: + type: object + properties: + error: + type: string + description: invalid_username + error_description: + type: string + description: The dl_username parameter is invalid + ResponseThree: + type: object + properties: + error: + type: string + description: invalid_mobile + error_description: + type: string + description: The dl_mobile parameter is invalid + ResponseFour: + type: object + properties: + error: + type: string + description: multiple_mobile_accounts + error_description: + type: string + description: The mobile number provided is associated with more than + one DigiLocker accounts. Please login using username. + ResponseFive: + type: object + properties: + error: + type: string + description: otp_error + error_description: + type: string + description: OTP could not be sent as the account may not have a + valid mobile or a valid email. + ResponseSix: + type: object + properties: + error: + type: string + description: unexpected_error + error_description: + type: string + description: Internal server error + ResponseSeven: + type: object + properties: + error: + type: string + description: partner_service_unresponsive + error_description: + type: string + description: Internal server error + Response1: + type: object + properties: + error: + type: string + description: repository_service_inactive + error_description: + type: string + description: Internal server error + Response2: + type: object + properties: + error: + type: string + description: repository_service_unpublished + error_description: + type: string + description: Internal server error + Response3: + type: object + properties: + error: + type: string + description: repository_service_unresponsive + error_description: + type: string + description: Internal server error + Response4: + type: object + properties: + error: + type: string + description: repository_service_configerror + error_description: + type: string + description: Internal server error + Response5: + type: object + properties: + error: + type: string + description: repository_service_resperror + error_description: + type: string + description: Internal server error + Response6: + type: object + properties: + error: + type: string + description: repository_service_exception + error_description: + type: string + description: Internal server error + Response7: + type: object + properties: + error: + type: string + description: parameter_missing + error_description: + type: string + description: One or more of the mandatory parameters is missing + Response8: + type: object + properties: + error: + type: string + description: invalid_ts + error_description: + type: string + description: Timestamp parameter is invalid + Response9: + type: object + properties: + error: + type: string + description: hmac_mismatch + error_description: + type: string + description: HMAC does not match + Response10: + type: object + properties: + error: + type: string + description: mobile_exists + error_description: + type: string + description: A DigiLocker account already exists with this mobile + number. + Response11: + type: object + properties: + error: + type: string + description: auth_failure + error_description: + type: string + description: The data on Aadhaar does not match with one or more of + Aadhaar, Name, DOB and Gender data provided. Aadhaar + demographic authentication failure. + Response12: + type: object + properties: + error: + type: string + description: invalid_parameter + error_description: + type: string + description: One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|- +  uid parameter is missing or invalid  Name parameter + is missing or invalid  Dob parameter is missing or + invalid  Gender parameter is missing or invalid  + Mobile parameter is missing or invalid  Verification + parameter is missing or invalid  Consent parameter is + missing or invalid  Timestamp parameter is missing or + invalid  HMAC parameter is missing or invalid + Response13: + type: object + properties: + error: + type: string + description: repository_service_configerror + error_description: + type: string + description: The issuer service is not available. Please contact + DigiLocker support. + Response14: + type: object + properties: + error: + type: string + description: invalid_orgid + error_description: + type: string + description: The orgid parameter is missing or invalid. + Response15: + type: object + properties: + error: + type: string + description: invalid_doctype + error_description: + type: string + description: The doctype parameter is missing or invalid. + Response16: + type: object + properties: + error: + type: string + description: pull_response_pending + error_description: + type: string + description: The details provided above do not exactly match with the + details on the certificate. Your request has been + forwarded to the Issuer department. The Issuer + department will verify the details provided above. If + the verification is successful, your certificate will be + made available in the Issued Documents section of your + DigiLocker. + Response17: + type: object + properties: + error: + type: string + description: uri_exists + error_description: + type: string + description: This document already exists in your Issued Documents. + Response18: + type: object + properties: + error: + type: string + description: aadhaar_not_linked + error_description: + type: string + description: To access issued documents, please link your Aadhaar + number to your DigiLocker account. + securitySchemes: + oauthsecurity: + type: oauth2 + flows: + clientCredentials: + tokenUrl: 'https://betaapi.digitallocker.gov.in/public/oauth2/1/token' + scopes: + default: default scope + oauthAuthorizeCode: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: 'https://betaapi.digitallocker.gov.in/public/oauth2/1/authorize' + tokenUrl: 'https://betaapi.digitallocker.gov.in/public/oauth2/1/token' + scopes: {} + bearerAuth: + type: http + scheme: bearer + Customkeys1: + type: apiKey + in: header + name: X1123 + Customkey2: + type: apiKey + in: header + name: X-2 diff --git a/src/impl/digilocker/spec/issuer.yaml b/src/impl/digilocker/spec/issuer.yaml new file mode 100644 index 0000000..48168ec --- /dev/null +++ b/src/impl/digilocker/spec/issuer.yaml @@ -0,0 +1,426 @@ +openapi: 3.0.2 +info: + title: DigiLocker Issuer APIs + description: This document provides detailed specification of the Digital Locker Pull APIs. The Pull model of integration with Digital Locker enables a Digital Locker user to search a document/certificate from issuer repository and fetch (pull) it into Digital Locker. The issuer departments can use these APIs for the documents that are not Aadhaar seeded. The issuer organization integrating with Digital Locker maintains the documents/certificates in its own repository (database or file system). The issuer application provides APIs to Digital Locker to access the documents in this repository. Each issuer organization will have to implement 2 APIs to integrate with the Digital Locker system. + termsOfService: 'https://ndh.digitallocker.gov.in/terms.php' + contact: + email: support@digitallocker.gov.in + version: 3.0.0 +servers: + - url: 'Your API URL' +paths: + /Your Pull URI Request API Path: + post: + tags: + - APIs + summary: Pull URI Request API . + description: The Pull URI Request API has to be implemented by the issuers and will be consumed by Digital Locker application. This API will be invoked when a citizen searches the issuer repository for his/her certificate. If the certificate data is Aadhaar seeded, the issuer may choose to use Aadhaar number as the search parameter. Digital Locker provides Aadhaar number, name and date of birth as on Aadhaar to the issuer API as additional parameters. The option for these Aadhaar based parameters can be selected while configuring this API in Digital Locker Partner’s Portal. If the certificate data is not Aadhaar seeded then the issuer may use any other unique parameter e.g. driving license number to search for a driving license. These custom parameters will be passed in the UDF elements as shown in the sample request below. The custom parameter(s) can be configured while configuring the API in the DigiLocker Partner’s Portal. The Digital Locker system will query the issuer repository to fetch the URI for any document that match the search criteria. The citizen can save this URI in his/her Digital Locker. It is strongly recommended that the issuer API validate that the name, date of birth details sent by DigiLocker in Aadhaar parameters match with the corresponding details on the certificate before returning the certificate data. This will ensure that only authentic owners get access to a certificate. + + operationId: Pull Uri + parameters: + - name: Content-Type + description: application/xml + in: header + required: false + schema: + type: string + - name: x-digilocker-hmac + description: This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. + in: header + required: false + schema: + type: string + + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/PullURIRequest' + + + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/PullURIResponse' + + + /Your Pull DOC Request API Path: + post: + tags: + - APIs + summary: Pull Doc Request API. + description: The Pull Doc Request API has to be implemented by the issuers and will be consumed by Digital Locker system. This API will be invoked when the resident clicks on the URI displayed in the Issued documents section of DigLocker. The issuer API will by sending the certificate data. The certificate data should be sent in one of the two formats depending on the request send by Digital Locker:|- + a. PDF document format + b. XML format for machine readable metadata + + operationId: Pull Doc + parameters: + - name: Content-Type + description: application/xml + in: header + required: false + schema: + type: string + - name: x-digilocker-hmac + description: This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. + in: header + required: false + schema: + type: string + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/PullDocRequest' + + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/PullDocResponse' + + +components: + schemas: + PullURIRequest: + type: object + properties: + ver: + type: string + minLength: 1 + description: API version. + xml: + attribute: true + ts: + type: string + minLength: 1 + description: A timestamp value. This will be used to decode the keyHash element described below. + xml: + attribute: true + txn: + type: string + minLength: 1 + description: Transaction id. + xml: + attribute: true + orgId: + type: string + description: Org Id is the user id provided to the Digital Locker application by the issuer application for accessing the API. + xml: + attribute: true + format: + type: string + minLength: 1 + description: >- + Indicates the desired format of the certificate data in the response. Possible values of this attribute are: + xml: for certificate data in machine readable xml format. + pdf: for certificate data in printable pdf format + both: for certificate data in both xml and pdf format. If the format attribute is not present in the request, then the API must return Base64 encoded PDF data in the response. Please see the response section below for more details + xml: + attribute: true + DocDetails: + type: object + properties: + DocType: + type: string + description: Digital Locker will pass the document type being searched in this parameter. + example: Pdf + items: + properties: {} + + DigiLockerId: + type: string + description: A unique 36 character DigiLocker Id of the user account. + example: 123e4567-e89b-12d3-a456-426655440000 + items: + properties: {} + UID: + type: string + description: Aadhaar number of the DigiLocker user searching for the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + example: 123443211122 + items: + properties: {} + FullName: + type: string + description: Name of the DigiLocker user searching for the document/certificate as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + example: Sunil + items: + properties: {} + DOB: + type: string + description: Date of birth of the DigiLocker user searching for the document/certificate as on Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + example: 09-08-1989 + items: + properties: {} + Photo: + type: string + description: The base 64 encoded contents of JPEG photograph as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + items: + properties: {} + UDF1: + type: string + description: User defined search parameters to search a unique document/certificate. The may be for CBSE, for Transportation Dept. and for Income Tax Dept. The search parameters for the API will be configured in the issuer portal of Digital Locker while configuring this API. + items: + properties: {} + UDF2: + type: string + items: + properties: {} + UDF3: + type: string + items: + properties: {} + UDFn: + type: string + items: + properties: {} + required: + - DocType + + - DigiLockerId + - UID + - FullName + - DOB + - Photo + - UDF1 + - UDF2 + - UDF3 + - UDFn + required: + - ver + - ts + - txn + - orgId + - format + - DocDetails + PullURIResponse: + type: object + properties: + ResponseStatus: + type: object + properties: + Status: + type: string + minLength: 1 + description: 1 for success, 0 for error and 9 for pending. + xml: + attribute: true + ts: + type: string + minLength: 1 + description: A timestamp value as sent in the request. + xml: + attribute: true + txn: + type: string + minLength: 1 + description: Transaction id value as sent in the request. + xml: + attribute: true + + required: + - Status + - ts + - txn + + DocDetails: + type: object + description: Issuer can add meta content specific to document here. + properties: + DocType: + type: string + minLength: 1 + example: INCER + description: The document type sent in the original request. + DigiLockerId: + type: string + minLength: 1 + example: 123e4567-e89b-12d3-a456-426655440000 + description: A unique 36 character DigiLocker Id as sent in the original request. + UID: + type: string + minLength: 1 + example: 123412341234 + description: The Aadhaar number if sent in the original request. + FullName: + type: string + minLength: 1 + example: Sunil Kumar + description: The full name if sent in the original request. + DOB: + type: string + minLength: 1 + example: 31-12-1990 + description: The date of birth if sent in the original request. + UDF1: + type: string + minLength: 1 + example: 1333 + description: Search parameters sent in the original request. + UDF2: + type: string + minLength: 1 + example: 2016 + description: Search parameters sent in the original request. + URI: + type: string + minLength: 1 + example: in.gov.dept.state-INCER-1234567 + description: URI corresponding to the search criteria that identifies the document uniquely. + DocContent: + type: string + minLength: 1 + description: Enclose the Base64 byte encoded contents of PDF file in this element. + DataContent: + type: string + minLength: 1 + description: Enclose the base64 byte encoded certificate metadata in XML format. The DataContent element should be sent only if the original request contains format attribute as “xml” or “both”. + required: + - DocType + - DigiLockerId + - UID + - FullName + - DOB + - UDF1 + - UDF2 + - URI + - DocContent + - DataContent + required: + - ResponseStatus + + - DocDetails + PullDocRequest: + type: object + properties: + ver: + type: string + minLength: 1 + description: API version. + xml: + attribute: true + ts: + type: string + minLength: 1 + description: A timestamp value. This will be used to decode the keyHash element described below. + xml: + attribute: true + txn: + type: string + description: Transaction id. + xml: + attribute: true + orgId: + type: string + description: Org Id is the user id provided to the Digital Locker application by the issuer application for accessing the API. + xml: + attribute: true + format: + type: string + minLength: 1 + description: >- + The certificate data in the response. Possible values of this attribute are: + xml: for certificate data in machine readable xml format + pdf: for certificate data in printable pdf format + both: for certificate data in both xml and pdf format. If the format attribute is not present in the request, then the API must return Base64 encoded PDF data in the response. Please see the response section below for more details. + xml: + attribute: true + DocDetails: + type: object + properties: + URI: + type: string + minLength: 1 + example: in.gov.kerala.edistrict-INCER-123456 + description: URI identifies the document uniquely. + DigiLockerId: + type: string + minLength: 1 + example: 123e4567-e89b-12d3-a456-426655440000 + description: A unique 36 character DigiLocker Id of the user account. + + UID: + type: string + minLength: 1 + example: 123456789012 + description: Aadhaar number of the DigiLocker user accessing the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + FullName: + type: string + minLength: 1 + example: Sunil Kumar + description: Name of the DigiLocker user accessing the document/certificate as in Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + DOB: + type: string + minLength: 1 + example: 31-12-1990 + description: Date of birth of the DigiLocker user accessing the document/certificate as in Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + required: + - URI + - DigiLockerId + + - UID + - FullName + - DOB + required: + - ver + - ts + - txn + - orgId + - format + - DocDetails + PullDocResponse: + type: object + properties: + ResponseStatus: + type: object + properties: + Status: + type: string + minLength: 1 + description: 1 for success, 0 for error. + xml: + attribute: true + ts: + type: string + minLength: 1 + description: A timestamp value as sent in the request. + xml: + attribute: true + txn: + type: string + description: Transaction id value as sent in the request. + xml: + attribute: true + + required: + - Status + - ts + - txn + + DocDetails: + type: object + description: Issuer can add meta content specific to document here. + properties: + + DocContent: + type: string + minLength: 1 + description: Enclose the Base64 byte encoded contents of PDF file in this element. The DocContent element should be sent only if the format attribute in the original request is sent as “pdf” or “both” or is absent. + DataContent: + type: string + minLength: 1 + description: Enclose the Base64 byte encoded certificate metadata in XML format. The DataContent element should be sent only if the original request contains format attribute as “xml” or “both”. + required: + + - DocContent + - DataContent + required: + - ResponseStatus + - DocDetails + + diff --git a/src/impl/digilocker/wrapper/index.ts b/src/impl/digilocker/wrapper/index.ts new file mode 100644 index 0000000..7d7b582 --- /dev/null +++ b/src/impl/digilocker/wrapper/index.ts @@ -0,0 +1,9 @@ +import createClient from 'openapi-fetch'; +import { paths } from '../schema/authpartner.schema'; + +const { get, post, put, patch, del } = createClient({ + baseUrl: 'https://myserver.com/api/v1/', + headers: { + Authorization: `Bearer test`, + }, +}); From 632ffe2862768d62c669bc6ddd4122cd144b4e78 Mon Sep 17 00:00:00 2001 From: ChakshuGautam Date: Sun, 25 Jun 2023 10:01:41 +0530 Subject: [PATCH 2/2] Fix: lint issues --- .../digilocker/schema/authpartner.schema.d.ts | 811 ++++++++++-------- src/impl/digilocker/schema/issuer.schema.d.ts | 74 +- 2 files changed, 473 insertions(+), 412 deletions(-) diff --git a/src/impl/digilocker/schema/authpartner.schema.d.ts b/src/impl/digilocker/schema/authpartner.schema.d.ts index 249ba4b..81cb892 100644 --- a/src/impl/digilocker/schema/authpartner.schema.d.ts +++ b/src/impl/digilocker/schema/authpartner.schema.d.ts @@ -3,161 +3,160 @@ * Do not make direct changes to the file. */ - export interface paths { - "/oauth2/1/authorize": { + '/oauth2/1/authorize': { /** - * Get Authorization Code + * Get Authorization Code * @description Call to this API starts authorization flow using OAuth 2.0 protocol. This isn't an API call—it's a DigiLocker web page that lets the user sign in to DigiLocker and authorize your application to access user’s data. After the user decides whether or not to authorize your app, they will be redirected to the redirect link provided by your application. */ - get: operations["Get Authorization Code id"]; + get: operations['Get Authorization Code id']; }; - "/oauth2/1/token": { + '/oauth2/1/token': { /** - * Get Access Token + * Get Access Token * @description This endpoint only applies to apps using the authorization code flow. An app calls this endpoint to acquire a bearer token once the user has authorized the app. Calls to /oauth2/1/token need to be authenticated using the app's key and secret. These can either be passed as application/x-www-form-urlencoded POST parameters (see parameters below) or via HTTP basic authentication. If basic authentication is used, the app key should be provided as the username, and the app secret should be provided as the password. */ - post: operations["getaccesstoken id"]; + post: operations['getaccesstoken id']; }; - "/oauth2/1/code": { + '/oauth2/1/code': { /** - * Get Device Code + * Get Device Code * @description The client device calls the DigiLocker API to get the device code by providing the client_id issued to the device OEM and either the username or the mobile number of the user. DigiLocker responds with a device code and then sends an OTP on the mobile number and email address associated with the user’s account. The masked mobile number and email address is also sent in response. The device should use these values to notify the users about the mobile and email address on which the OTP has been sent. */ - post: operations["Get Device Code id"]; + post: operations['Get Device Code id']; }; - "/oauth2/1/revoke": { + '/oauth2/1/revoke': { /** - * Revoke Token. + * Revoke Token. * @description Client applications can revoke a previously obtained refresh or access token when it is no longer needed. This is done by making a request to the token revocation endpoint. DigiLocker will invalidate the specified token and, if applicable, other tokens based on the same authorisation grant. This API may be used to sign out a user from DigiLocker. This API will work for server based web applications, mobile application and limited input devices. */ - post: operations["get token revocation id"]; + post: operations['get token revocation id']; }; - "/oauth2/1/user": { + '/oauth2/1/user': { /** - * Get User Details + * Get User Details * @description Client applications can call this API to get the DigiLocker Id, name, date of birth and gender of the account holder. An access token is required to call this API. The API will return the user details of the account with which the access token is linked. It is strongly recommended that the API can be called by client application only once after acquiring the access token. Since the user details do not change, the client application may store the values and use them when necessary than calling this API repeatedly. */ - get: operations["Account Detail API id"]; + get: operations['Account Detail API id']; }; - "/oauth2/1/files/": { + '/oauth2/1/files/': { /** - * Get List of Self Uploaded Documents + * Get List of Self Uploaded Documents * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. */ - get: operations["Get List of Self Uploaded Documents"]; + get: operations['Get List of Self Uploaded Documents']; }; - "/oauth2/1/files/{id}": { + '/oauth2/1/files/{id}': { /** - * Get List of Self Uploaded Documents + * Get List of Self Uploaded Documents * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. */ - get: operations["Get List of Self Uploaded Documents id"]; + get: operations['Get List of Self Uploaded Documents id']; }; - "/oauth2/2/files/issued": { + '/oauth2/2/files/issued': { /** - * Issued Documents + * Issued Documents * @description Returns the list of meta-data about issued documents in user’s DigiLocker. */ - get: operations["Get List of issued Documents id"]; + get: operations['Get List of issued Documents id']; }; - "/oauth2/1/files/issued": { + '/oauth2/1/files/issued': { /** - * Issued Documents + * Issued Documents * @description Returns the list of meta-data about issued documents in user’s DigiLocker. */ - get: operations["Get List of issued Documents Version1 id"]; + get: operations['Get List of issued Documents Version1 id']; }; - "/oauth2/1/file/{uri}": { + '/oauth2/1/file/{uri}': { /** - * Get File from URI + * Get File from URI * @description Returns a file from URI. This API can be used to fetch both issued document and uploaded document. */ - get: operations["Get File from URI id"]; + get: operations['Get File from URI id']; }; - "/oauth2/1/xml/{uri}": { + '/oauth2/1/xml/{uri}': { /** - * Get Certificate Data in XML Format from URI + * Get Certificate Data in XML Format from URI * @description Returns the certificate data in machine readable XML format for a URI. This API can be used to only for issued documents. The XML data may not be available for all documents. If the XML data is available for a particular document, the mime parameter in Get List of Issued Documents API will contain application/xml. Please refer to Digital Locker XML Certificate Formats for more details of XML formats of various documents. */ - get: operations["Get Certificate Data in XML Format from URI id"]; + get: operations['Get Certificate Data in XML Format from URI id']; }; - "/oauth2/2/xml/eaadhaar": { + '/oauth2/2/xml/eaadhaar': { /** - * Get e-Aadhaar Data in XML Format + * Get e-Aadhaar Data in XML Format * @description Returns e-Aadhaar data in XML format for the account. */ - get: operations["Get e-Aadhaar Data in XML Format id"]; + get: operations['Get e-Aadhaar Data in XML Format id']; }; - "/oauth2/1/file/upload": { + '/oauth2/1/file/upload': { /** - * Upload file to locker + * Upload file to locker * @description This API can be used to save/upload a file to uploaded documents in DigiLocker. The allowed file types are JPG, JPEG, PNG and PDF. The file size must not exceed 10MB. */ - post: operations["Upload File to Locker id"]; + post: operations['Upload File to Locker id']; }; - "/oauth2/1/pull/pulldocument": { + '/oauth2/1/pull/pulldocument': { /** - * Pull Document + * Pull Document * @description This API allows a client application to search a document/certificate from issuer’s repository using the parameters provided by a user. The searched document is saved in user’s issued document section of DigiLocker if the search is successful. */ - post: operations["Pull Document id"]; + post: operations['Pull Document id']; }; - "/signup/2/demoauth": { + '/signup/2/demoauth': { /** - * SIGN UP + * SIGN UP * @description This API is used to validate Aadhaar details and verify the mobile number by generating an OTP. This API call, if successful, will be followed by verify OTP call by the partner application if the user is online or available to perform OTP validation as indicated in verification parameter */ - post: operations["SIGN UP id"]; + post: operations['SIGN UP id']; }; - "/signup/1/demoauthverify": { + '/signup/1/demoauthverify': { /** - * Verify OTP + * Verify OTP * @description This API is used to verify the OTP sent by DigiLocker during the sign up API call above. */ - post: operations["Verify OTP id"]; + post: operations['Verify OTP id']; }; - "/oauth2/1/pull/issuers": { + '/oauth2/1/pull/issuers': { /** - * Get List of Issuers + * Get List of Issuers * @description Returns the list of issuers registered with DigiLocker. */ - post: operations["Get List of Issuers id"]; + post: operations['Get List of Issuers id']; }; - "/oauth2/1/pull/doctype": { + '/oauth2/1/pull/doctype': { /** - * Get List of Documents Provided by an Issuer + * Get List of Documents Provided by an Issuer * @description Returns a list of documents/certificates issued by an issuer organization registered with DigiLocker. */ - post: operations["Get List of Documents Provided by an Issuer id"]; + post: operations['Get List of Documents Provided by an Issuer id']; }; - "/oauth2/1/pull/parameters": { + '/oauth2/1/pull/parameters': { /** - * Get Search Parameters for a Document + * Get Search Parameters for a Document * @description Returns a list of parameters required to search a document/certificate of an issuer organization registered with DigiLocker. These parameters are used to pull a document from issuer’s repository using Pull Document API mentioned in subsequent section. */ - post: operations["Get Search Parameters for a Document id"]; + post: operations['Get Search Parameters for a Document id']; }; - "/account/2/verify": { + '/account/2/verify': { /** - * Verify Account + * Verify Account * @description This API can be used to verify whether a mobile number or Aadhaar number is already registered with DigiLocker. */ - post: operations["Verify Account id"]; + post: operations['Verify Account id']; }; - "/account/1/pushuri": { + '/account/1/pushuri': { /** - * Push URI to Account + * Push URI to Account * @description The API can use to push or delete a single URI into Digital Locker using DigiLocker Id acquired using Get User Details API. This API can be used to push the certificate details to Digital Locker as and when a certificate is generated in the issuer system. The issuing departments must register on DigiLocker as a registered Issuer and implement the requisite Issuer APIs as mentioned in Digital Locker Issuer API Specification document prior to pushing certificates using this API. */ - post: operations["Push URI to Account id"]; + post: operations['Push URI to Account id']; }; - "/statistics/1/counts": { + '/statistics/1/counts': { /** - * Get Statistics + * Get Statistics * @description Returns DigiLocker statistics such as the count of users, authentic documents, issuers and requesters as on a specific date. */ - post: operations["Get Statistics id"]; + post: operations['Get Statistics id']; }; } @@ -167,7 +166,7 @@ export interface components { schemas: { AccessToken: { /** @enum {string} */ - grant_type: "authorization_code"; + grant_type: 'authorization_code'; /** @example ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 */ code?: string; /** @example https://ndh.digitallocker.gov.in/oauth2-redirect.html */ @@ -181,63 +180,63 @@ export interface components { }; AccessResponse: { /** - * @description The access token that can be used to call the DigiLocker APIs. + * @description The access token that can be used to call the DigiLocker APIs. * @example bc125c212a4b03a9a188a858be5a163f379e878a */ access_token: string; /** - * Format: int64 - * @description The duration in seconds for which the access token is valid + * Format: int64 + * @description The duration in seconds for which the access token is valid * @example 3600 */ expires_in: number; /** - * @description The type of token which will always be Bearer. + * @description The type of token which will always be Bearer. * @example Bearer */ token_type: string; /** @description Scope of the token. */ scope: string; /** - * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. * @example a47ab18c593703e4f83a274694db7422a8cfcb8f */ refresh_token: string; /** - * @description A unique 36 character DigiLocker Id of the user account. + * @description A unique 36 character DigiLocker Id of the user account. * @example 123e4567-e89b-12d3-a456-426655440000 */ digilocker_id: string; /** - * @description The name of the user as registered with DigiLocker. + * @description The name of the user as registered with DigiLocker. * @example Sunil Kumar */ name: string; /** - * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. + * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. * @enum {string} */ - eaadhar: "Y" | "N"; + eaadhar: 'Y' | 'N'; /** - * Format: dd-mm-yyy - * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. + * Format: dd-mm-yyy + * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. * @example 31121970 */ dob: number; /** - * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. + * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. * @enum {string} */ - gender: "M" | "F" | "T"; + gender: 'M' | 'F' | 'T'; /** - * @description A unique reference of the user account. + * @description A unique reference of the user account. * @example 1c66bec26364cd6fefaabc6cae91840a */ reference_key: string; }; RefreshToken: { /** @enum {string} */ - grant_type: "refresh_token"; + grant_type: 'refresh_token'; /** @example ca82123a5476aa2f5e4638957c0ecc55c6ec07c1 */ refresh_token: string; /** @example ABCDEFG */ @@ -254,7 +253,7 @@ export interface components { DeviceAuthorizationCode: { client_id?: string; /** - * @description The parameter must be set to device_code. + * @description The parameter must be set to device_code. * @example device_code */ response_type?: string; @@ -268,22 +267,22 @@ export interface components { }; DeviceAuthorizationCodeResponse: { /** - * @description The device verification code. + * @description The device verification code. * @example 74tq5miHKB */ device_code: string; /** - * @description The masked mobile number on which the OTP is sent. + * @description The masked mobile number on which the OTP is sent. * @example XXXXXX1234 */ dl_masked_mobile: number; /** - * @description The masked email on which the OTP is sent. + * @description The masked email on which the OTP is sent. * @example xxxxxx@gmail.com */ dl_masked_email: string; /** - * @description The duration in seconds for which the code is valid. + * @description The duration in seconds for which the code is valid. * @example 600 */ expires_in: number; @@ -292,7 +291,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ client_id?: string; /** - * @description The grant type, which must be “urn:ietf:params:oauth:grant-type:device_code”. + * @description The grant type, which must be “urn:ietf:params:oauth:grant-type:device_code”. * @example urn:ietf:params:oauth:grant-type:device_code */ grant_type?: string; @@ -304,19 +303,19 @@ export interface components { AuthTokenResponse: { /** * @description The access token that can be used to call the - * DigiLocker APIs. + * DigiLocker APIs. * @example bc125c212a4b03a9a188a858be5a163f379e878a */ access_token: string; /** - * Format: int64 + * Format: int64 * @description The duration in seconds for which the access token is - * valid. + * valid. * @example 3600 */ expires_in: number; /** - * @description The type of token which will always be Bearer. + * @description The type of token which will always be Bearer. * @example Bearer */ token_type: string; @@ -326,14 +325,14 @@ export interface components { * @description The refresh token used to refresh the above access * token when it expires. This will value will be * returned only in case of web applications and not be - * returned for limited input devices. + * returned for limited input devices. * @example ad6f4004cc3e53f56bda391fe485fc4d32928061 */ refresh_token: string; }; FileUpload: { /** @description The mime type of the file e.g. image/jpg, image/jpeg, image/png, application/pdf. */ - "Content-Type"?: string; + 'Content-Type'?: string; }; FileUploadResponse: { details?: { @@ -347,7 +346,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -360,10 +359,10 @@ export interface components { /** @description This is date of birth of the user as mentioned in Aadhaar in DDMMYYYY format. */ dob?: number; /** - * @description This is gender of the user as mentioned in Aadhaar. The possible values are M, F, T for male, female and transgender respectively. + * @description This is gender of the user as mentioned in Aadhaar. The possible values are M, F, T for male, female and transgender respectively. * @enum {unknown} */ - gender?: "M" | "F" | "T"; + gender?: 'M' | 'F' | 'T'; /** @description The parameter indicates whether the mobile number provided above should be validated by DigiLocker. If this parameter is ‘Y’, the DigiLocker sends an OTP to verify the mobile number. In this case the client application will call the second API to validate the OTP. The user will be signed on only after successful OTP validation. This flow should be used when the user account is created by user himself/herself or the user is present to provide the OTP. If this parameter is ‘N’, the user account will be created without OTP validation. The OTP validation will be performed when the user signs in for the first time in DigiLocker. This flow should be used when the user account needs to be created in the absence of the user. */ verification?: string; /** @description The consent indicator from the user for performing demographic authentication using Aadhaar details. This Partner Application must capture the user consent for performing the Aadhaar demographic authentication. The possible values are ‘Y’ and ‘N’. The sign up request will be processed only when this indicator is ‘Y’. */ @@ -376,32 +375,32 @@ export interface components { DemoAuthResponse: { details?: { /** - * @description The access token that can be used to call the DigiLocker APIs. + * @description The access token that can be used to call the DigiLocker APIs. * @example bc125c212a4b03a9a188a858be5a163f379e878a */ access_token: string; /** - * @description The duration in seconds for which the access token is valid. + * @description The duration in seconds for which the access token is valid. * @example 3600 */ expires_in: string; /** - * @description The type of token which will always be Bearer. + * @description The type of token which will always be Bearer. * @example Bearer */ token_type: string; /** - * @description Scope of the token + * @description Scope of the token * @example */ scope: string; /** - * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. * @example a47ab18c593703e4f83a274694db7422a8cfcb8f */ refresh_token: string; /** - * @description The masked mobile number of the user on which the OTP has been sent. + * @description The masked mobile number of the user on which the OTP has been sent. * @example ******3712 */ mobile: number; @@ -411,7 +410,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -425,46 +424,46 @@ export interface components { DemoAuthVerifyResponse: { details?: { /** - * @description The access token that can be used to call the DigiLocker APIs. + * @description The access token that can be used to call the DigiLocker APIs. * @example bc125c212a4b03a9a188a858be5a163f379e878a */ access_token: string; /** - * @description The duration in seconds for which the access token is valid. + * @description The duration in seconds for which the access token is valid. * @example 3600 */ expires_in: string; /** - * @description The type of token which will always be Bearer. + * @description The type of token which will always be Bearer. * @example Bearer */ token_type: string; /** - * @description Scope of the token + * @description Scope of the token * @example */ scope: string; /** - * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. + * @description The refresh token used to refresh the above access token when it expires. Please refer to Refresh Access Token API for more details. * @example a47ab18c593703e4f83a274694db7422a8cfcb8f */ refresh_token: string; }; }; IssuerResponse: { - issuers: ({ - name: string; - description: string; - categories: string; - issuerid: string; - orgid: string; - })[]; + issuers: { + name: string; + description: string; + categories: string; + issuerid: string; + orgid: string; + }[]; }; Issuer: { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -475,7 +474,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -485,16 +484,16 @@ export interface components { orgid?: string; }; DocTypeResponse: { - documents: ({ - doctype: string; - description: string; - })[]; + documents: { + doctype: string; + description: string; + }[]; }; SearchParameters: { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -505,17 +504,17 @@ export interface components { /** @description A 5 character unique document type provided by DigiLocker. */ doctype?: string; }; - SearchParametersResponse: ({ - label: string; - paramname: string; - valuelist?: unknown; - example: string; - })[]; + SearchParametersResponse: { + label: string; + paramname: string; + valuelist?: unknown; + example: string; + }[]; VerifyAccount: { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -528,12 +527,12 @@ export interface components { }; VerifyAccountResponse: { /** - * @description true indicates that the provided Aadhaar/mobile number is already registered and false indicates otherwise. + * @description true indicates that the provided Aadhaar/mobile number is already registered and false indicates otherwise. * @example true */ registered: string; /** - * @description A unique 36 character DigiLocker Id of the user account. + * @description A unique 36 character DigiLocker Id of the user account. * @example 123e4567-e89b-12d3-a456-426655440000 */ digilockerid: string; @@ -542,7 +541,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -567,7 +566,7 @@ export interface components { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ clientid?: string; /** - * Format: binary + * Format: binary * @description Provide SHA-256 encrypted value of the client secret, clientid and ts parameters above concatenated in this sequence (client secret, clientid, ts). The hmac parameter is used by DigiLocker to ensure the data integrity and authentication of the request. Use the Client Secret Key generated during the application registration process on Partners Portal as the client secret. */ hmac?: string; @@ -576,70 +575,70 @@ export interface components { }; GetStatisticsResponse: { /** - * @description Count of registered users on DigiLocker. + * @description Count of registered users on DigiLocker. * @example 25873490 */ users: string; /** - * @description Count of authentic documents available through DigiLocker. + * @description Count of authentic documents available through DigiLocker. * @example 3520475277 */ authentic_documents: string; /** - * @description Count of issuer organizations registered on DigiLocker. + * @description Count of issuer organizations registered on DigiLocker. * @example 134 */ issuers: string; /** - * @description Count of requester organizations registered on DigiLocker. + * @description Count of requester organizations registered on DigiLocker. * @example 45 */ requestors: string; /** - * @description The date on which this statistics is generated. + * @description The date on which this statistics is generated. * @example 31072019 */ count_as_on: string; /** @description List of last 12 months cumulative user registrations */ monthwise_registations: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18496 */ id?: number; /** - * @description Month of the year in numeric format with January as 1 + * @description Month of the year in numeric format with January as 1 * @example 5 */ month?: number; /** - * @description Year in YYYY format + * @description Year in YYYY format * @example 2018 */ year?: number; /** - * @description Count of cumulative user registrations in the given month. + * @description Count of cumulative user registrations in the given month. * @example 124794 */ count?: number; details2?: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18496 */ id?: number; /** - * @description Month of the year in numeric format with January as 1 + * @description Month of the year in numeric format with January as 1 * @example 5 */ month?: number; /** - * @description Year in YYYY format + * @description Year in YYYY format * @example 2018 */ year?: number; /** - * @description Count of cumulative user registrations in the given month. + * @description Count of cumulative user registrations in the given month. * @example 124794 */ count?: number; @@ -648,68 +647,68 @@ export interface components { /** @description List of cumulative year-wise counts of authentic documents in DigiLocker. */ yearwise_authentic_documents: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18347 */ id?: number; /** - * @description Year in YYYY format. + * @description Year in YYYY format. * @example 2016 */ year?: number; /** * @description Count of cumulative user authentic documents in - * the given year. + * the given year. * @example 10134567 */ count?: number; details?: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18350 */ id?: number; /** - * @description Year in YYYY format. + * @description Year in YYYY format. * @example 2017 */ year?: number; /** - * @description Count of cumulative user authentic documents in the given year. + * @description Count of cumulative user authentic documents in the given year. * @example 1000548093 */ count?: number; }; details1?: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18354 */ id?: number; /** - * @description Year in YYYY format. + * @description Year in YYYY format. * @example 2018 */ year?: number; /** - * @description Count of cumulative user authentic documents in the given year. + * @description Count of cumulative user authentic documents in the given year. * @example 2410543684 */ count?: number; }; details2?: { /** - * @description Unique id of the list item. + * @description Unique id of the list item. * @example 18567 */ id?: number; /** - * @description Year in YYYY format. + * @description Year in YYYY format. * @example 2019 */ year?: number; /** - * @description Count of cumulative user authentic documents in the given year. + * @description Count of cumulative user authentic documents in the given year. * @example 3520475277 */ count?: number; @@ -717,7 +716,7 @@ export interface components { }; }; XMLFormatSchema: { - CertificateData: (unknown)[]; + CertificateData: unknown[]; Signature: { SignedInfo?: unknown; SignatureValue?: unknown; @@ -975,12 +974,11 @@ export interface components { export type external = Record; export interface operations { - /** - * Get Authorization Code + * Get Authorization Code * @description Call to this API starts authorization flow using OAuth 2.0 protocol. This isn't an API call—it's a DigiLocker web page that lets the user sign in to DigiLocker and authorize your application to access user’s data. After the user decides whether or not to authorize your app, they will be redirected to the redirect link provided by your application. */ - "Get Authorization Code id": { + 'Get Authorization Code id': { parameters: { query: { /** @description Provide the client id that was created during the application registration process on Partners Portal. */ @@ -997,10 +995,10 @@ export interface operations { * The code_challenge sent as this parameter is the Base64URL (with no * padding) encoded SHA256 hash of the code verifier. * Code block: - * + * * ``` * string base64_url_encode_without_padding(string arg) - * { + * { * string s = base64encode(arg); //Regular base64encoder with padding * s = s.replace(’=’,’’); //Remove any trailing ’=’ * s = s.replace(’+’, ’-’); //Replace ’+’ with ’-’ @@ -1021,7 +1019,7 @@ export interface operations { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { details?: { access_token: string; expires_in: number; @@ -1036,17 +1034,17 @@ export interface operations { }; }; /** - * Get Access Token + * Get Access Token * @description This endpoint only applies to apps using the authorization code flow. An app calls this endpoint to acquire a bearer token once the user has authorized the app. Calls to /oauth2/1/token need to be authenticated using the app's key and secret. These can either be passed as application/x-www-form-urlencoded POST parameters (see parameters below) or via HTTP basic authentication. If basic authentication is used, the app key should be provided as the username, and the app secret should be provided as the password. */ - "getaccesstoken id": { + 'getaccesstoken id': { /** @description Details of documents being created. */ requestBody: { content: { - "application/json": { - "Get access token using authorization code"?: components["schemas"]["AccessToken"]; - "Get access token using refresh token"?: components["schemas"]["RefreshToken"]; - "Get access token using device code and OTP"?: components["schemas"]["DeviceAccessToken"]; + 'application/json': { + 'Get access token using authorization code'?: components['schemas']['AccessToken']; + 'Get access token using refresh token'?: components['schemas']['RefreshToken']; + 'Get access token using device code and OTP'?: components['schemas']['DeviceAccessToken']; }; }; }; @@ -1054,7 +1052,7 @@ export interface operations { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["AccessResponse"]; + 'application/json': components['schemas']['AccessResponse']; }; }; /** @description Bad request */ @@ -1064,32 +1062,36 @@ export interface operations { }; }; /** - * Get Device Code + * Get Device Code * @description The client device calls the DigiLocker API to get the device code by providing the client_id issued to the device OEM and either the username or the mobile number of the user. DigiLocker responds with a device code and then sends an OTP on the mobile number and email address associated with the user’s account. The masked mobile number and email address is also sent in response. The device should use these values to notify the users about the mobile and email address on which the OTP has been sent. */ - "Get Device Code id": { + 'Get Device Code id': { requestBody?: { content: { - "application/json": components["schemas"]["DeviceAuthorizationCode"]; + 'application/json': components['schemas']['DeviceAuthorizationCode']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["DeviceAuthorizationCodeResponse"]; + 'application/json': components['schemas']['DeviceAuthorizationCodeResponse']; }; }; /** @description Bad Request */ 400: { content: { - "application/json": components["schemas"]["ResponseOne"] | components["schemas"]["ResponseTwo"] | components["schemas"]["ResponseThree"] | components["schemas"]["ResponseFour"]; + 'application/json': + | components['schemas']['ResponseOne'] + | components['schemas']['ResponseTwo'] + | components['schemas']['ResponseThree'] + | components['schemas']['ResponseFour']; }; }; /** @description The client_id parameter is invalid. */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -1100,26 +1102,28 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["ResponseFive"] | components["schemas"]["ResponseSix"]; + 'application/json': + | components['schemas']['ResponseFive'] + | components['schemas']['ResponseSix']; }; }; }; }; /** - * Revoke Token. + * Revoke Token. * @description Client applications can revoke a previously obtained refresh or access token when it is no longer needed. This is done by making a request to the token revocation endpoint. DigiLocker will invalidate the specified token and, if applicable, other tokens based on the same authorisation grant. This API may be used to sign out a user from DigiLocker. This API will work for server based web applications, mobile application and limited input devices. */ - "get token revocation id": { + 'get token revocation id': { requestBody?: { content: { - "application/json": { + 'application/json': { /** @description The token that needs to be revoked. */ token: string; /** - * @description The type of the above token. The value will be one of access_token or refresh_token. If this parameter is not sent, DigiLocker will look for this token in both access and refresh tokens and then revoke it. + * @description The type of the above token. The value will be one of access_token or refresh_token. If this parameter is not sent, DigiLocker will look for this token in both access and refresh tokens and then revoke it. * @enum {string} */ - token_type_hint?: "refresh_token" | "access_token"; + token_type_hint?: 'refresh_token' | 'access_token'; }; }; }; @@ -1131,42 +1135,42 @@ export interface operations { }; }; /** - * Get User Details + * Get User Details * @description Client applications can call this API to get the DigiLocker Id, name, date of birth and gender of the account holder. An access token is required to call this API. The API will return the user details of the account with which the access token is linked. It is strongly recommended that the API can be called by client application only once after acquiring the access token. Since the user details do not change, the client application may store the values and use them when necessary than calling this API repeatedly. */ - "Account Detail API id": { + 'Account Detail API id': { responses: { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { details?: { /** - * @description A unique 36 character DigiLocker Id of the user account. + * @description A unique 36 character DigiLocker Id of the user account. * @example 123e4567-e89b-12d3-a456-426655440000 */ digilockerid: string; /** - * @description The name of the user as registered with DigiLocker. + * @description The name of the user as registered with DigiLocker. * @example Sunil Kumar */ name: string; /** - * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. + * @description This indicates whether eAadhaar data is available for this account. Possible values are Y and N. * @enum {string} */ - eaadhar?: "Y" | "N"; + eaadhar?: 'Y' | 'N'; /** - * Format: dd-mm-yyy - * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. + * Format: dd-mm-yyy + * @description This is date of birth of the user as registered with DigiLocker in DDMMYYYY format. * @example 31121970 */ dob: string; /** - * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. + * @description This is gender of the user as registered with DigiLocker. The possible values are M, F, T for male, female and transgender respectively. * @enum {string} */ - gender: "M" | "F" | "T"; + gender: 'M' | 'F' | 'T'; }; }; }; @@ -1174,7 +1178,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1185,7 +1189,7 @@ export interface operations { /** @description Internal server error */ 500: { content: { - "application/json": { + 'application/json': { /** @example unexpected_error */ error?: string; /** @example Internal server error */ @@ -1196,36 +1200,36 @@ export interface operations { }; }; /** - * Get List of Self Uploaded Documents + * Get List of Self Uploaded Documents * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. */ - "Get List of Self Uploaded Documents": { + 'Get List of Self Uploaded Documents': { responses: { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { directory: string; - items: ({ - /** @example 189079894 */ - id: string; - name: string; - type: string; - size: string; - date: string; - parent: string; - mime: string; - uri: string; - description: string; - issuer: string; - })[]; + items: { + /** @example 189079894 */ + id: string; + name: string; + type: string; + size: string; + date: string; + parent: string; + mime: string; + uri: string; + description: string; + issuer: string; + }[]; }; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1236,7 +1240,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @example invalid_id */ error?: string; /** @example The folder does not exist */ @@ -1247,7 +1251,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @example unexpected_error */ error?: string; /** @example Internal server error */ @@ -1258,10 +1262,10 @@ export interface operations { }; }; /** - * Get List of Self Uploaded Documents + * Get List of Self Uploaded Documents * @description Returns the list of meta-data about documents or folders in user’s DigiLocker in a specific location. */ - "Get List of Self Uploaded Documents id": { + 'Get List of Self Uploaded Documents id': { parameters: { path: { /** @description The id of the folder to list. To list the files of root folder of a user’s locker, do not send this parameter. This is sent as a part of the URL. */ @@ -1272,55 +1276,55 @@ export interface operations { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { details?: { /** - * @description The name of the file or folder. + * @description The name of the file or folder. * @example My Documents */ name: string; /** - * @description String dir for folder and string file for file. + * @description String dir for folder and string file for file. * @example dir */ type: string; /** - * @description The id if this item is a folder. + * @description The id if this item is a folder. * @example 5678 */ id: number; /** - * @description Size of file or folder. + * @description Size of file or folder. * @example 366481 */ size: string; /** - * @description This contains the date of file upload in case of self uploaded documents + * @description This contains the date of file upload in case of self uploaded documents * @example 2015-05-12T15:50:38Z */ date: string; /** - * @description The id of the parent folder. + * @description The id of the parent folder. * @example 1234 */ parent: string; /** - * @description The mime type of the file. This field will contain “application/PDF” for PDF files; “image/png” for PNG files and “image/jpg” or “image/jpeg” for JPG/JPEG files. This will be blank in case of folder. + * @description The mime type of the file. This field will contain “application/PDF” for PDF files; “image/png” for PNG files and “image/jpg” or “image/jpeg” for JPG/JPEG files. This will be blank in case of folder. * @example */ mime: string; /** - * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. URI will be blank in case of folder. + * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. URI will be blank in case of folder. * @example */ uri: string; /** - * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. + * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. * @example */ description: string; /** - * @description The name of the issuer. This is blank in case of uploaded documents and folders. + * @description The name of the issuer. This is blank in case of uploaded documents and folders. * @example */ issuer: string; @@ -1331,7 +1335,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1342,7 +1346,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @example invalid_id */ error?: string; /** @example The folder does not exist */ @@ -1353,7 +1357,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @example unexpected_error */ error?: string; /** @example Internal server error */ @@ -1364,28 +1368,28 @@ export interface operations { }; }; /** - * Issued Documents + * Issued Documents * @description Returns the list of meta-data about issued documents in user’s DigiLocker. */ - "Get List of issued Documents id": { + 'Get List of issued Documents id': { responses: { /** @description successful operation */ 200: { content: { - "application/json": { - items: ({ - name: string; - type: string; - size: string; - date: string; - parent: string; - mime?: (unknown)[]; - uri: string; - doctype: string; - description: string; - issuerid: string; - issuer: string; - })[]; + 'application/json': { + items: { + name: string; + type: string; + size: string; + date: string; + parent: string; + mime?: unknown[]; + uri: string; + doctype: string; + description: string; + issuerid: string; + issuer: string; + }[]; resource: string; }; }; @@ -1393,7 +1397,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1404,74 +1408,76 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["ResponseSix"] | components["schemas"]["ResponseSeven"]; + 'application/json': + | components['schemas']['ResponseSix'] + | components['schemas']['ResponseSeven']; }; }; }; }; /** - * Issued Documents + * Issued Documents * @description Returns the list of meta-data about issued documents in user’s DigiLocker. */ - "Get List of issued Documents Version1 id": { + 'Get List of issued Documents Version1 id': { responses: { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { details?: { /** - * @description The name of the certificate. + * @description The name of the certificate. * @example Class XII Marksheet */ name: string; /** - * @description String file. + * @description String file. * @example file */ type: string; /** - * @description This will be blank. + * @description This will be blank. * @example */ size: string; /** - * @description This contains the date on which the certificate was last modified in DigiLocker. + * @description This contains the date on which the certificate was last modified in DigiLocker. * @example 2015-05-12T15:50:38Z */ date: string; /** - * @description This will be blank. + * @description This will be blank. * @example */ parent: string; /** - * @description The list of mime types for the certificate data. This field will contain “application/PDF” or “application/xml”. + * @description The list of mime types for the certificate data. This field will contain “application/PDF” or “application/xml”. * @example application/pdf */ mime: string; /** - * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. + * @description This is the unique identifier of the document shared by the user in DigiLocker. You will use this identifier to get the actual file from DigiLocker using the API. * @example in.gov.cbse-HSCER-201412345678 */ uri: string; /** - * @description A 5 character unique document type provided by DigiLocker. + * @description A 5 character unique document type provided by DigiLocker. * @example HSCER */ doctype: string; /** - * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. + * @description This is the descriptive document type stored in DigiLocker such as ‘Income Certificate’ or ‘Driving License’. * @example Class XII Marksheet */ description: string; /** - * @description The name of the issuer. + * @description The name of the issuer. * @example CBSE */ issuer: string; /** - * @description Unique DigiLocker issuer id as mentioned in the URI. + * @description Unique DigiLocker issuer id as mentioned in the URI. * @example in.gov.cbse */ issuerid: string; @@ -1482,7 +1488,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1493,16 +1499,18 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["ResponseSix"] | components["schemas"]["ResponseSeven"]; + 'application/json': + | components['schemas']['ResponseSix'] + | components['schemas']['ResponseSeven']; }; }; }; }; /** - * Get File from URI + * Get File from URI * @description Returns a file from URI. This API can be used to fetch both issued document and uploaded document. */ - "Get File from URI id": { + 'Get File from URI id': { parameters: { path: { /** @description This is the unique identifier of the document. */ @@ -1513,16 +1521,16 @@ export interface operations { /** @description successful operation */ 200: { content: { - "application/pdf": string; - "image/jpg": string; - "image/jpeg": string; - "image/png": string; + 'application/pdf': string; + 'image/jpg': string; + 'image/jpeg': string; + 'image/png': string; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @example uri_missing */ error?: string; /** @example URI parameter missing */ @@ -1533,7 +1541,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1544,7 +1552,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @example invalid_uri */ error?: string; /** @example No file found for given URI */ @@ -1555,22 +1563,28 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + 'application/json': + | components['schemas']['Response3'] + | components['schemas']['Response4'] + | components['schemas']['Response5'] + | components['schemas']['Response6']; }; }; /** @description Gateway timeout */ 503: { content: { - "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + 'application/json': + | components['schemas']['Response1'] + | components['schemas']['Response2']; }; }; }; }; /** - * Get Certificate Data in XML Format from URI + * Get Certificate Data in XML Format from URI * @description Returns the certificate data in machine readable XML format for a URI. This API can be used to only for issued documents. The XML data may not be available for all documents. If the XML data is available for a particular document, the mime parameter in Get List of Issued Documents API will contain application/xml. Please refer to Digital Locker XML Certificate Formats for more details of XML formats of various documents. */ - "Get Certificate Data in XML Format from URI id": { + 'Get Certificate Data in XML Format from URI id': { parameters: { path: { uri: string; @@ -1580,13 +1594,13 @@ export interface operations { /** @description successful operation */ 200: { content: { - "application/xml": components["schemas"]["XMLFormatSchema"]; + 'application/xml': components['schemas']['XMLFormatSchema']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @example uri_missing */ error?: string; /** @example URI parameter missing */ @@ -1597,7 +1611,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1608,7 +1622,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @example invalid_uri */ error?: string; /** @example No file found for given URI */ @@ -1619,33 +1633,39 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + 'application/json': + | components['schemas']['Response3'] + | components['schemas']['Response4'] + | components['schemas']['Response5'] + | components['schemas']['Response6']; }; }; /** @description Gateway timeout */ 503: { content: { - "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + 'application/json': + | components['schemas']['Response1'] + | components['schemas']['Response2']; }; }; }; }; /** - * Get e-Aadhaar Data in XML Format + * Get e-Aadhaar Data in XML Format * @description Returns e-Aadhaar data in XML format for the account. */ - "Get e-Aadhaar Data in XML Format id": { + 'Get e-Aadhaar Data in XML Format id': { responses: { /** @description successful operation */ 200: { content: { - "application/xml": components["schemas"]["EaadharXamlSchema"]; + 'application/xml': components['schemas']['EaadharXamlSchema']; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid token */ error?: string; /** @example The access token is invalid */ @@ -1656,33 +1676,41 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @enum {unknown} */ - error?: "aadhaar_not_linked" | "aadhaar_not_available"; + error?: 'aadhaar_not_linked' | 'aadhaar_not_available'; /** @enum {unknown} */ - error_description?: "Aadhaar is not linked to the account" | "Aadhaar data is not available for this user. Please perform Aadhaar eKYC again."; + error_description?: + | 'Aadhaar is not linked to the account' + | 'Aadhaar data is not available for this user. Please perform Aadhaar eKYC again.'; }; }; }; /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["Response3"] | components["schemas"]["Response4"] | components["schemas"]["Response5"] | components["schemas"]["Response6"]; + 'application/json': + | components['schemas']['Response3'] + | components['schemas']['Response4'] + | components['schemas']['Response5'] + | components['schemas']['Response6']; }; }; /** @description Gateway timeout */ 503: { content: { - "application/json": components["schemas"]["Response1"] | components["schemas"]["Response2"]; + 'application/json': + | components['schemas']['Response1'] + | components['schemas']['Response2']; }; }; }; }; /** - * Upload file to locker + * Upload file to locker * @description This API can be used to save/upload a file to uploaded documents in DigiLocker. The allowed file types are JPG, JPEG, PNG and PDF. The file size must not exceed 10MB. */ - "Upload File to Locker id": { + 'Upload File to Locker id': { parameters: { header?: { /** @description The destination path of the file in DigiLocker including filename. */ @@ -1693,35 +1721,57 @@ export interface operations { }; requestBody?: { content: { - "application/octet-stream": components["schemas"]["FileUpload"]; - "image/png": string; - "image/jpeg": string; - "image/jpg": string; - "image/pdf": string; + 'application/octet-stream': components['schemas']['FileUpload']; + 'image/png': string; + 'image/jpeg': string; + 'image/jpg': string; + 'image/pdf': string; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["FileUploadResponse"]; + 'application/json': components['schemas']['FileUploadResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @enum {unknown} */ - error?: "path_missing" | "contenttype_missing" | "hmac_missing" | "filename_missing" | "hmac_mismatch" | "invalid_filename" | "invalid_filesize" | "invalid_filetype" | "invalid_path" | "file_data_missing" | "mimetype_mismatch"; + error?: + | 'path_missing' + | 'contenttype_missing' + | 'hmac_missing' + | 'filename_missing' + | 'hmac_mismatch' + | 'invalid_filename' + | 'invalid_filesize' + | 'invalid_filetype' + | 'invalid_path' + | 'file_data_missing' + | 'mimetype_mismatch'; /** @enum {unknown} */ - error_description?: "Path parameter is missing" | "Content-Type parameter is missing" | "HMAC parameter is missing" | "Filename is missing in path parameter" | "HMAC does not match" | "Restricted characters are not allowed in file name" | "The file size exceeds maximum allowed file size of 10MB" | "The file type is not allowed" | "The destination folder does not exist" | "Missing file content in the request" | "The mimetype provided in Content-Type parameter does not match with the mimetype of the file"; + error_description?: + | 'Path parameter is missing' + | 'Content-Type parameter is missing' + | 'HMAC parameter is missing' + | 'Filename is missing in path parameter' + | 'HMAC does not match' + | 'Restricted characters are not allowed in file name' + | 'The file size exceeds maximum allowed file size of 10MB' + | 'The file type is not allowed' + | 'The destination folder does not exist' + | 'Missing file content in the request' + | 'The mimetype provided in Content-Type parameter does not match with the mimetype of the file'; }; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1732,7 +1782,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: string; /** @description Internal server error */ @@ -1743,20 +1793,20 @@ export interface operations { }; }; /** - * Pull Document + * Pull Document * @description This API allows a client application to search a document/certificate from issuer’s repository using the parameters provided by a user. The searched document is saved in user’s issued document section of DigiLocker if the search is successful. */ - "Pull Document id": { + 'Pull Document id': { requestBody?: { content: { - "application/x-www-form-urlencoded": components["schemas"]["PullDocumentSchema"]; + 'application/x-www-form-urlencoded': components['schemas']['PullDocumentSchema']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": { + 'application/json': { details?: { uri: string; }; @@ -1766,13 +1816,15 @@ export interface operations { /** @description Bad request */ 400: { content: { - "application/json": components["schemas"]["Response13"] | components["schemas"]["ResponseSix"]; + 'application/json': + | components['schemas']['Response13'] + | components['schemas']['ResponseSix']; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_token */ error?: string; /** @example The access token is invalid */ @@ -1783,7 +1835,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @description record_not_found */ error?: unknown; /** @description No record found in issuer database for given criteria. Please check the details and try again. If problem persists, see the FAQ section for possible causes. */ @@ -1794,38 +1846,46 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": components["schemas"]["Response14"] | components["schemas"]["Response15"] | components["schemas"]["Response16"] | components["schemas"]["Response17"] | components["schemas"]["Response18"]; + 'application/json': + | components['schemas']['Response14'] + | components['schemas']['Response15'] + | components['schemas']['Response16'] + | components['schemas']['Response17'] + | components['schemas']['Response18']; }; }; }; }; /** - * SIGN UP + * SIGN UP * @description This API is used to validate Aadhaar details and verify the mobile number by generating an OTP. This API call, if successful, will be followed by verify OTP call by the partner application if the user is online or available to perform OTP validation as indicated in verification parameter */ - "SIGN UP id": { + 'SIGN UP id': { requestBody?: { content: { - "multipart/form-data": components["schemas"]["DemoAuth"]; + 'multipart/form-data': components['schemas']['DemoAuth']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["DemoAuthResponse"]; + 'application/json': components['schemas']['DemoAuthResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": components["schemas"]["Response10"] | components["schemas"]["Response11"] | components["schemas"]["Response12"]; + 'application/json': + | components['schemas']['Response10'] + | components['schemas']['Response11'] + | components['schemas']['Response12']; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -1836,7 +1896,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -1847,32 +1907,35 @@ export interface operations { }; }; /** - * Verify OTP + * Verify OTP * @description This API is used to verify the OTP sent by DigiLocker during the sign up API call above. */ - "Verify OTP id": { + 'Verify OTP id': { requestBody?: { content: { - "multipart/form-data": components["schemas"]["DemoAuthVerify"]; + 'multipart/form-data': components['schemas']['DemoAuthVerify']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["DemoAuthVerifyResponse"]; + 'application/json': components['schemas']['DemoAuthVerifyResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": components["schemas"]["Response7"] | components["schemas"]["Response8"] | components["schemas"]["Response9"]; + 'application/json': + | components['schemas']['Response7'] + | components['schemas']['Response8'] + | components['schemas']['Response9']; }; }; /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -1883,7 +1946,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -1894,26 +1957,26 @@ export interface operations { }; }; /** - * Get List of Issuers + * Get List of Issuers * @description Returns the list of issuers registered with DigiLocker. */ - "Get List of Issuers id": { + 'Get List of Issuers id': { requestBody?: { content: { - "application/x-www-form-urlencoded": components["schemas"]["Issuer"]; + 'application/x-www-form-urlencoded': components['schemas']['Issuer']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["IssuerResponse"]; + 'application/json': components['schemas']['IssuerResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @example invalid_parameter */ error?: string; /** @example One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ @@ -1924,7 +1987,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -1935,7 +1998,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -1946,26 +2009,26 @@ export interface operations { }; }; /** - * Get List of Documents Provided by an Issuer + * Get List of Documents Provided by an Issuer * @description Returns a list of documents/certificates issued by an issuer organization registered with DigiLocker. */ - "Get List of Documents Provided by an Issuer id": { + 'Get List of Documents Provided by an Issuer id': { requestBody?: { content: { - "application/x-www-form-urlencoded": components["schemas"]["DocType"]; + 'application/x-www-form-urlencoded': components['schemas']['DocType']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["DocTypeResponse"]; + 'application/json': components['schemas']['DocTypeResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @description invalid_parameter */ error?: unknown; /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  The orgid parameter is missing or invalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ @@ -1976,7 +2039,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -1987,7 +2050,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -1998,26 +2061,26 @@ export interface operations { }; }; /** - * Get Search Parameters for a Document + * Get Search Parameters for a Document * @description Returns a list of parameters required to search a document/certificate of an issuer organization registered with DigiLocker. These parameters are used to pull a document from issuer’s repository using Pull Document API mentioned in subsequent section. */ - "Get Search Parameters for a Document id": { + 'Get Search Parameters for a Document id': { requestBody?: { content: { - "application/x-www-form-urlencoded": components["schemas"]["SearchParameters"]; + 'application/x-www-form-urlencoded': components['schemas']['SearchParameters']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["SearchParametersResponse"]; + 'application/json': components['schemas']['SearchParametersResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @description invalid_parameter */ error?: unknown; /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  The orgid parameter is missing or invalid  The doctype parameter is missing or invalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ @@ -2028,7 +2091,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @example invalid_client_id */ error?: string; /** @example The client_id parameter is invalid */ @@ -2039,7 +2102,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -2050,26 +2113,26 @@ export interface operations { }; }; /** - * Verify Account + * Verify Account * @description This API can be used to verify whether a mobile number or Aadhaar number is already registered with DigiLocker. */ - "Verify Account id": { + 'Verify Account id': { requestBody?: { content: { - "multipart/form-data": components["schemas"]["VerifyAccount"]; + 'multipart/form-data': components['schemas']['VerifyAccount']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["VerifyAccountResponse"]; + 'application/json': components['schemas']['VerifyAccountResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @description invalid_parameter */ error?: unknown; /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Either one of uid or mobile number is mandatory  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ @@ -2080,7 +2143,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @description invalid_client_id */ error?: string; /** @description The client_id parameter is invalid */ @@ -2091,7 +2154,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: unknown; /** @description Internal server error */ @@ -2102,26 +2165,26 @@ export interface operations { }; }; /** - * Push URI to Account + * Push URI to Account * @description The API can use to push or delete a single URI into Digital Locker using DigiLocker Id acquired using Get User Details API. This API can be used to push the certificate details to Digital Locker as and when a certificate is generated in the issuer system. The issuing departments must register on DigiLocker as a registered Issuer and implement the requisite Issuer APIs as mentioned in Digital Locker Issuer API Specification document prior to pushing certificates using this API. */ - "Push URI to Account id": { + 'Push URI to Account id': { requestBody?: { content: { - "multipart/form-data": components["schemas"]["PushUri"]; + 'multipart/form-data': components['schemas']['PushUri']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": unknown; + 'application/json': unknown; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @description invalid_parameter */ error?: string; /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  URI parameter is missing or invalid  Doctype parameter is missing or invalid  Description parameter is missing or invalid  Docid parameter is missing or invalid  Issuedate parameter is missing orinvalid  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid  URI already exists in this account  URI already exists in another account */ @@ -2132,7 +2195,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @description invalid_client_id */ error?: string; /** @description The client_id parameter is invalid */ @@ -2143,7 +2206,7 @@ export interface operations { /** @description Not found */ 404: { content: { - "application/json": { + 'application/json': { /** @description invalid_digilocker_id */ error?: string; /** @description The digilockerid parameter is invalid */ @@ -2154,7 +2217,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: string; /** @description Internal server error */ @@ -2165,26 +2228,26 @@ export interface operations { }; }; /** - * Get Statistics + * Get Statistics * @description Returns DigiLocker statistics such as the count of users, authentic documents, issuers and requesters as on a specific date. */ - "Get Statistics id": { + 'Get Statistics id': { requestBody?: { content: { - "multipart/form-data": components["schemas"]["GetStatistics"]; + 'multipart/form-data': components['schemas']['GetStatistics']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/json": components["schemas"]["GetStatisticsResponse"]; + 'application/json': components['schemas']['GetStatisticsResponse']; }; }; /** @description Bad request */ 400: { content: { - "application/json": { + 'application/json': { /** @description invalid_parameter */ error?: string; /** @description One or more of the mandatory parameters is missing or invalid. The error description text will contain one or more of the following error texts:|-  Timestamp parameter is missing or invalid  HMAC parameter is missing or invalid */ @@ -2195,7 +2258,7 @@ export interface operations { /** @description Unauthorized error */ 401: { content: { - "application/json": { + 'application/json': { /** @description invalid_client_id */ error?: string; /** @description The client_id parameter is invalid */ @@ -2206,7 +2269,7 @@ export interface operations { /** @description Internal Error */ 500: { content: { - "application/json": { + 'application/json': { /** @description unexpected_error */ error?: string; /** @description Internal server error */ diff --git a/src/impl/digilocker/schema/issuer.schema.d.ts b/src/impl/digilocker/schema/issuer.schema.d.ts index fa312f8..7142a58 100644 --- a/src/impl/digilocker/schema/issuer.schema.d.ts +++ b/src/impl/digilocker/schema/issuer.schema.d.ts @@ -3,21 +3,20 @@ * Do not make direct changes to the file. */ - export interface paths { - "/Your Pull URI Request API Path": { + '/Your Pull URI Request API Path': { /** - * Pull URI Request API . + * Pull URI Request API . * @description The Pull URI Request API has to be implemented by the issuers and will be consumed by Digital Locker application. This API will be invoked when a citizen searches the issuer repository for his/her certificate. If the certificate data is Aadhaar seeded, the issuer may choose to use Aadhaar number as the search parameter. Digital Locker provides Aadhaar number, name and date of birth as on Aadhaar to the issuer API as additional parameters. The option for these Aadhaar based parameters can be selected while configuring this API in Digital Locker Partner’s Portal. If the certificate data is not Aadhaar seeded then the issuer may use any other unique parameter e.g. driving license number to search for a driving license. These custom parameters will be passed in the UDF elements as shown in the sample request below. The custom parameter(s) can be configured while configuring the API in the DigiLocker Partner’s Portal. The Digital Locker system will query the issuer repository to fetch the URI for any document that match the search criteria. The citizen can save this URI in his/her Digital Locker. It is strongly recommended that the issuer API validate that the name, date of birth details sent by DigiLocker in Aadhaar parameters match with the corresponding details on the certificate before returning the certificate data. This will ensure that only authentic owners get access to a certificate. */ - post: operations["Pull Uri"]; + post: operations['Pull Uri']; }; - "/Your Pull DOC Request API Path": { + '/Your Pull DOC Request API Path': { /** - * Pull Doc Request API. + * Pull Doc Request API. * @description The Pull Doc Request API has to be implemented by the issuers and will be consumed by Digital Locker system. This API will be invoked when the resident clicks on the URI displayed in the Issued documents section of DigLocker. The issuer API will by sending the certificate data. The certificate data should be sent in one of the two formats depending on the request send by Digital Locker:|- a. PDF document format b. XML format for machine readable metadata */ - post: operations["Pull Doc"]; + post: operations['Pull Doc']; }; } @@ -43,27 +42,27 @@ export interface components { format: string; DocDetails: { /** - * @description Digital Locker will pass the document type being searched in this parameter. + * @description Digital Locker will pass the document type being searched in this parameter. * @example Pdf */ DocType: string; /** - * @description A unique 36 character DigiLocker Id of the user account. + * @description A unique 36 character DigiLocker Id of the user account. * @example 123e4567-e89b-12d3-a456-426655440000 */ DigiLockerId: string; /** - * @description Aadhaar number of the DigiLocker user searching for the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Aadhaar number of the DigiLocker user searching for the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example 123443211122 */ UID: string; /** - * @description Name of the DigiLocker user searching for the document/certificate as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Name of the DigiLocker user searching for the document/certificate as on Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example Sunil */ FullName: string; /** - * @description Date of birth of the DigiLocker user searching for the document/certificate as on Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Date of birth of the DigiLocker user searching for the document/certificate as on Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example 09-08-1989 */ DOB: string; @@ -88,42 +87,42 @@ export interface components { /** @description Issuer can add meta content specific to document here. */ DocDetails: { /** - * @description The document type sent in the original request. + * @description The document type sent in the original request. * @example INCER */ DocType: string; /** - * @description A unique 36 character DigiLocker Id as sent in the original request. + * @description A unique 36 character DigiLocker Id as sent in the original request. * @example 123e4567-e89b-12d3-a456-426655440000 */ DigiLockerId: string; /** - * @description The Aadhaar number if sent in the original request. + * @description The Aadhaar number if sent in the original request. * @example 123412341234 */ UID: string; /** - * @description The full name if sent in the original request. + * @description The full name if sent in the original request. * @example Sunil Kumar */ FullName: string; /** - * @description The date of birth if sent in the original request. + * @description The date of birth if sent in the original request. * @example 31-12-1990 */ DOB: string; /** - * @description Search parameters sent in the original request. + * @description Search parameters sent in the original request. * @example 1333 */ UDF1: string; /** - * @description Search parameters sent in the original request. + * @description Search parameters sent in the original request. * @example 2016 */ UDF2: string; /** - * @description URI corresponding to the search criteria that identifies the document uniquely. + * @description URI corresponding to the search criteria that identifies the document uniquely. * @example in.gov.dept.state-INCER-1234567 */ URI: string; @@ -151,27 +150,27 @@ export interface components { format: string; DocDetails: { /** - * @description URI identifies the document uniquely. + * @description URI identifies the document uniquely. * @example in.gov.kerala.edistrict-INCER-123456 */ URI: string; /** - * @description A unique 36 character DigiLocker Id of the user account. + * @description A unique 36 character DigiLocker Id of the user account. * @example 123e4567-e89b-12d3-a456-426655440000 */ DigiLockerId: string; /** - * @description Aadhaar number of the DigiLocker user accessing the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Aadhaar number of the DigiLocker user accessing the document/certificate. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example 123456789012 */ UID: string; /** - * @description Name of the DigiLocker user accessing the document/certificate as in Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Name of the DigiLocker user accessing the document/certificate as in Aadhaar. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example Sunil Kumar */ FullName: string; /** - * @description Date of birth of the DigiLocker user accessing the document/certificate as in Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. + * @description Date of birth of the DigiLocker user accessing the document/certificate as in Aadhaar in DD-MM-YYYY format. This is an optional parameter and will be sent only if the issuer opts for it while configuring the API on Digital Locker Issuer Portal. * @example 31-12-1990 */ DOB: string; @@ -205,57 +204,56 @@ export interface components { export type external = Record; export interface operations { - /** - * Pull URI Request API . + * Pull URI Request API . * @description The Pull URI Request API has to be implemented by the issuers and will be consumed by Digital Locker application. This API will be invoked when a citizen searches the issuer repository for his/her certificate. If the certificate data is Aadhaar seeded, the issuer may choose to use Aadhaar number as the search parameter. Digital Locker provides Aadhaar number, name and date of birth as on Aadhaar to the issuer API as additional parameters. The option for these Aadhaar based parameters can be selected while configuring this API in Digital Locker Partner’s Portal. If the certificate data is not Aadhaar seeded then the issuer may use any other unique parameter e.g. driving license number to search for a driving license. These custom parameters will be passed in the UDF elements as shown in the sample request below. The custom parameter(s) can be configured while configuring the API in the DigiLocker Partner’s Portal. The Digital Locker system will query the issuer repository to fetch the URI for any document that match the search criteria. The citizen can save this URI in his/her Digital Locker. It is strongly recommended that the issuer API validate that the name, date of birth details sent by DigiLocker in Aadhaar parameters match with the corresponding details on the certificate before returning the certificate data. This will ensure that only authentic owners get access to a certificate. */ - "Pull Uri": { + 'Pull Uri': { parameters: { header?: { /** @description application/xml */ - "Content-Type"?: string; + 'Content-Type'?: string; /** @description This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. */ - "x-digilocker-hmac"?: string; + 'x-digilocker-hmac'?: string; }; }; requestBody?: { content: { - "application/xml": components["schemas"]["PullURIRequest"]; + 'application/xml': components['schemas']['PullURIRequest']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/xml": components["schemas"]["PullURIResponse"]; + 'application/xml': components['schemas']['PullURIResponse']; }; }; }; }; /** - * Pull Doc Request API. + * Pull Doc Request API. * @description The Pull Doc Request API has to be implemented by the issuers and will be consumed by Digital Locker system. This API will be invoked when the resident clicks on the URI displayed in the Issued documents section of DigLocker. The issuer API will by sending the certificate data. The certificate data should be sent in one of the two formats depending on the request send by Digital Locker:|- a. PDF document format b. XML format for machine readable metadata */ - "Pull Doc": { + 'Pull Doc': { parameters: { header?: { /** @description application/xml */ - "Content-Type"?: string; + 'Content-Type'?: string; /** @description This is used for authentication and to verify the integrity of the request. DigiLocker calculates the hash message authentication code (hmac) of the HTTP request body using SHA256 hashing algorithm and the API Key provided by the issuer as the hashing key. The API Key is specified by the issuer while configuring the Pull Doc API in DigiLocker Partner Portal. The resulting hmac is converted to Base64 format and sent in this parameter. It is strongly recommended that the issuer API calculates the hmac of the HTTP request body, convert it to Base64 and match it with this parameter to ensure authenticity of the request. */ - "x-digilocker-hmac"?: string; + 'x-digilocker-hmac'?: string; }; }; requestBody?: { content: { - "application/xml": components["schemas"]["PullDocRequest"]; + 'application/xml': components['schemas']['PullDocRequest']; }; }; responses: { /** @description successful operation */ 200: { content: { - "application/xml": components["schemas"]["PullDocResponse"]; + 'application/xml': components['schemas']['PullDocResponse']; }; }; };