curl --request POST \
--url https://dev-####.okta.com/api/v1/users \
--header 'authorization: SSWS <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"profile": {
"firstName": "Jane",
"lastName": "Doe",
"email": "[email protected]",
"login": "jdoe"
}
}'
curl --request POST \
--url https://dev-####.okta.com/api/v1/users/00ua4t9ugYY0pDxkE4x6 \
--header 'authorization: SSWS <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"credentials": {
"password": {
"value": "SomePassword123"
}
}
}'
curl --request POST \
--url https://dev-####.okta.com/api/v1/users/00ua4t9ugYY0pDxkE4x6/factors \
--header 'authorization: SSWS <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"factorType": "sms",
"provider": "OKTA",
"profile": {
"phoneNumber": "+18024482036"
}
}'
Response shows that it's PENDING_ACTIVATION
>>> HTTP 200
{
"id": "mbla4rvs8zLRuHLZN4x6",
"factorType": "sms",
"provider": "OKTA",
"vendorName": "OKTA",
"status": "PENDING_ACTIVATION",
"created": "2020-04-22T12:09:20.000Z",
"lastUpdated": "2020-04-22T12:09:20.000Z",
"profile": {
"phoneNumber": "+18024482036"
}
}
curl --request POST \
--url https://dev-####.okta.com/api/v1/users/00ua4t9ugYY0pDxkE4x6/factors/mbla4rvs8zLRuHLZN4x6/lifecycle/activate \
--header 'authorization: SSWS <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"passCode": "355946"
}'
Response shows that it's ACTIVE
>>> HTTP 200
{
"id": "smsa4tpxfgU1jL3jj4x6",
"factorType": "sms",
"provider": "OKTA",
"vendorName": "OKTA",
"status": "ACTIVE",
"created": "2020-04-22T12:09:56.000Z",
"lastUpdated": "2020-04-22T12:09:56.000Z",
"profile": {
"phoneNumber": "+18024482036"
}
}
curl --request DELETE \
--url https://dev-####.okta.com/api/v1/users/00ua4t9ugYY0pDxkE4x6/factors/smsa4tpxfgU1jL3jj4x6 \
--header 'authorization: SSWS <TOKEN>'
curl --request POST \
--url https://dev-####.okta.com/api/v1/users/00ua4t9ugYY0pDxkE4x6/factors \
--header 'authorization: SSWS <TOKEN>' \
--header 'content-type: application/json' \
--data '{
"factorType": "sms",
"provider": "OKTA",
"profile": {
"phoneNumber": "+18024482036"
}
}'
Response shows that it's ACTIVE
- even though activate is not true.
>>> HTTP 200
{
"id": "smsa4tqlqf1YIQHuW4x6",
"factorType": "sms",
"provider": "OKTA",
"vendorName": "OKTA",
"status": "ACTIVE",
"created": "2020-04-22T12:10:32.000Z",
"lastUpdated": "2020-04-22T12:10:32.000Z",
"profile": {
"phoneNumber": "+18024482036"
}
}