/

to search

Introducing Setu Changelog Check it out ↗

#List of components and their usage

#Full width image

Bridge

#Normal image

Bridge

#Next page


#Was this page helpful?


Was this page helpful?


#Badge


#Callout

Warning

Error

Tip

Highlight

Note


#CodeBlock

Change language parameter based on the code

import jwt
private_key = b"""-----BEGIN PRIVATE KEY-----
MIIBIjANBgkqhkiG9w0BAQE..............
-----END PRIVATE KEY-----"""
def makeDetachedJWS(payload, key):
encoded = jwt.encode(payload, key, algorithm="RS256")
splittedJWS = encoded.split(".")
splittedJWS[1] = ""
return ".".join(splittedJWS)
request_body = {"body":"test"}
detached_jws = makeDetachedJWS(request_body, private_key)

#Tabs


Test 1

You can also use components inside Tabs


import jwt
private_key = b"""-----BEGIN PRIVATE KEY-----
MIIBIjANBgkqhkiG9w0BAQE..............
-----END PRIVATE KEY-----"""
def makeDetachedJWS(payload, key):
encoded = jwt.encode(payload, key, algorithm="RS256")
splittedJWS = encoded.split(".")
splittedJWS[1] = ""
return ".".join(splittedJWS)
request_body = {"body":"test"}
detached_jws = makeDetachedJWS(request_body, private_key)

#Multiple responses with same status code


Type 1 (open by default)

Description 1


Request
POST /api/digilocker/
{
"redirectUrl": "https://setu.co"
}

Response

You will get the following details—

{
"id": "ea31e1e6-96eb-4e56-a355-7bc51de94d24",
"status": "unauthenticated", //ENUM values—unauthenticated | authenticated | revoked
"url": "User login url",
"validUpto": "2021-10-05T19:06:28+05:30"
}

Type 2

Description 2


Request
POST /api/digilocker/
{
"redirectUrl": "https://setu.co"
}

Response

You will get the following details—

{
"id": "ea31e1e6-96eb-4e56-a355-7bc51de94d24",
"status": "unauthenticated", //ENUM values—unauthenticated | authenticated | revoked
"url": "User login url",
"validUpto": "2021-10-05T19:06:28+05:30"
}