(redirectURLs())
- list - List all redirect URLs
- create - Create a redirect URL
- get - Retrieve a redirect URL
- delete - Delete a redirect URL
Lists all whitelisted redirect_urls for the instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.SDKError;
import com.clerk.backend_api.models.operations.ListRedirectURLsResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
ListRedirectURLsResponse res = sdk.redirectURLs().list()
.call();
if (res.redirectURLList().isPresent()) {
// handle response
}
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
ListRedirectURLsResponse
Error Object |
Status Code |
Content Type |
models/errors/SDKError |
4xx-5xx |
*/* |
Create a redirect URL
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.SDKError;
import com.clerk.backend_api.models.operations.CreateRedirectURLRequestBody;
import com.clerk.backend_api.models.operations.CreateRedirectURLResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
CreateRedirectURLRequestBody req = CreateRedirectURLRequestBody.builder()
.build();
CreateRedirectURLResponse res = sdk.redirectURLs().create()
.request(req)
.call();
if (res.redirectURL().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
CreateRedirectURLResponse
Error Object |
Status Code |
Content Type |
models/errors/ClerkErrors |
400,422 |
application/json |
models/errors/SDKError |
4xx-5xx |
*/* |
Retrieve the details of the redirect URL with the given ID
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.SDKError;
import com.clerk.backend_api.models.operations.GetRedirectURLResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
GetRedirectURLResponse res = sdk.redirectURLs().get()
.id("<id>")
.call();
if (res.redirectURL().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter |
Type |
Required |
Description |
id |
String |
✔️ |
The ID of the redirect URL |
GetRedirectURLResponse
Error Object |
Status Code |
Content Type |
models/errors/ClerkErrors |
404 |
application/json |
models/errors/SDKError |
4xx-5xx |
*/* |
Remove the selected redirect URL from the whitelist of the instance
package hello.world;
import com.clerk.backend_api.Clerk;
import com.clerk.backend_api.models.errors.SDKError;
import com.clerk.backend_api.models.operations.DeleteRedirectURLResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
try {
Clerk sdk = Clerk.builder()
.bearerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build();
DeleteRedirectURLResponse res = sdk.redirectURLs().delete()
.id("<id>")
.call();
if (res.deletedObject().isPresent()) {
// handle response
}
} catch (com.clerk.backend_api.models.errors.ClerkErrors e) {
// handle exception
throw e;
} catch (SDKError e) {
// handle exception
throw e;
} catch (Exception e) {
// handle exception
throw e;
}
}
}
Parameter |
Type |
Required |
Description |
id |
String |
✔️ |
The ID of the redirect URL |
DeleteRedirectURLResponse
Error Object |
Status Code |
Content Type |
models/errors/ClerkErrors |
404 |
application/json |
models/errors/SDKError |
4xx-5xx |
*/* |