POST /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
Content-Type: application/json
{
"factorType" : " push" ,
"provider" : " duo" ,
"deviceType" : " smartphone:ios" ,
"profile" : {
"deviceName" : " My iPhone"
}
}
HTTP/1.1 301 MOVED PERMANENTLY
Location: http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO
Content-Type: application/json
{
"id" : " 00ud4tVDDXYVKPXKVLCO" ,
"factorType" : " push" ,
"status" : " PENDING_ACTIVATION" ,
"expiresAt" : " 2013-06-24T17:39:18.000Z" ,
"created" : " 2013-06-24T16:39:18.000Z" ,
"activated" : " null" ,
"lastVerification" : " null" ,
"lastUpdated" : " 2013-07-02T21:36:25.344Z" ,
"profile" : {
"deviceName" : " My iPhone"
},
"_embedded" : {
"install" : {
"appStore" : " <link-to-the-push-app>" ,
"barcode" : " <bar-code-that-has-to-be-scanned-by-the-app-to-register" >
},
},
"_links" : {
"next" : {
"name" :" poll" ,
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" ]
}
},
"self" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" , " DELETE" ]
}
},
"poll" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" ]
}
},
"user" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
},
"provider" : {
"href" : " http://rain.okta1.com:1802/api/v1/factors/providers/duo" ,
"hints" : {
"allow" : [" GET" ]
}
}
}
Get/Poll Status of the SMS Factor
Poll before it was activated
GET /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
Content-Type: application/json
{
"id" : " 00ud4tVDDXYVKPXKVLCO" ,
"factorType" : " push" ,
"status" : " PENDING_ACTIVATION" ,
"expiresAt" : " 2013-06-24T17:39:18.000Z" ,
"created" : " 2013-06-24T16:39:18.000Z" ,
"activated" : " null" ,
"lastVerification" : " null" ,
"lastUpdated" : " 2013-07-02T21:36:25.344Z" ,
"profile" : {
"deviceName" : " My iPhone"
},
"_links" : {
"next" : {
"name" :" poll" ,
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" ]
}
},
"self" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" , " DELETE" ]
}
},
"poll" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" ]
}
},
"user" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
},
"provider" : {
"href" : " http://rain.okta1.com:1802/api/v1/factors/providers/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
}
}
Poll after it was activated
GET /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
Content-Type: application/json
{
"id" : " 00ud4tVDDXYVKPXKVLCO" ,
"factorType" : " push" ,
"status" : " ACTIVATED" ,
"created" : " 2013-06-24T16:39:18.000Z" ,
"activated" : " 2013-06-24T22:39:18.000Z" ,
"lastVerification" : " 2013-06-24T22:39:18.000Z" ,
"lastUpdated" : " 2013-06-24T22:39:18.000Z" ,
"profile" : {
"deviceName" : " My iPhone"
},
"_links" : {
"self" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" , " DELETE" ]
}
},
"deactivate" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/deactivate" ,
"hints" : {
"allow" : [" POST" ]
}
},
"user" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
},
"provider" : {
"href" : " http://rain.okta1.com:1802/api/v1/factors/providers/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
}
}
Poll for a factor that was never activated
GET /api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO HTTP/1.1
Host: your-subdomain.okta.com
Authorization: SSWS yourtoken
Accept: application/json
Content-Type: application/json
{
"id" : " 00ud4tVDDXYVKPXKVLCO" ,
"factorType" : " push" ,
"status" : " EXPIRED" ,
"created" : " 2013-06-24T16:39:18.000Z" ,
"expired" : " 2013-06-24T22:39:18.000Z" ,
"lastVerification" : null ,
"lastUpdated" : " 2013-06-24T22:39:18.000Z" ,
"profile" : {
"deviceName" : " My iPhone"
},
"_links" : {
"self" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO" ,
"hints" : {
"allow" : [" GET" , " DELETE" ]
}
},
"activate" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN/factors/00ud4tVDDXYVKPXKVLCO/lifecycle/activate" ,
"hints" : {
"allow" : [" POST" ]
}
},
"user" : {
"href" : " http://rain.okta1.com:1802/api/v1/users/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
},
"provider" : {
"href" : " http://rain.okta1.com:1802/api/v1/factors/providers/00TmqQCMPRSYHBDHVWAN" ,
"hints" : {
"allow" : [" GET" ]
}
}
}