app icon indicating copy to clipboard operation
app copied to clipboard

Custom alias creation error: "Alias creation time is expired, please retry"

Open tylernix opened this issue 1 year ago • 1 comments

I am using the SimpleLogin API to create a custom alias. I have created an API key. I can call other endpoints successfully, but when I call the /alias/custom/new endpoint, it returns this error every time.

Request

POST https://app.simplelogin.io/api/v3/alias/custom/new
{
    "alias_prefix": "my-new-prefix",
    "alias_suffix": "my-domain-I-set-up",
    "mailbox_ids": [520663, 520971],
    "note": "Testing",
    "name": "Test"
}

Response

412 PRECONDITION FAILED 
{
    "error": "Alias creation time is expired, please retry"
}

Retrying doesn't work. I have tried recreating the API key. I have tried different configurations of field names and values. Nothing seems to work.

Has anyone else seen this issue?

tylernix avatar Apr 29 '23 19:04 tylernix

Yes, there are two issues with your request

  1. There is no 'alias_suffix'. It is called 'signed_suffix'.
  2. The 'signed_suffix' is not "my-domain-I-set-up" as it needs to be signed. First, you need to call GET /api/v4/alias/options endpoint to get a temporary signed version of your domain name. Each /alias/options call will give you a new 'signed_suffix' and I guess there is an expiration (time limit) to use it.

Sherlock1979 avatar May 04 '23 23:05 Sherlock1979