> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://apidocs.sare.africa/sare-core-api/identity/verify-device-change-security-answer/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.sare.africa/_mcp/server. # Verify Device-Change Security Answer POST http://localhost:8080/api/v3/auth/device-change/verify Content-Type: application/json Reference: https://apidocs.sare.africa/sare-core-api/identity/verify-device-change-security-answer ## Request ### Headers - `Authorization` (string, optional) - `X-Device-Id` (string, optional) — Optional ### Body (application/json) This endpoint expects an object. - `phone` (string, optional) - `questionId` (string, optional) - `answer` (string, optional) ## Response ### 200 200 OK - `code` (integer, optional) - `message` (string, optional) ## Errors ### 400 Bad Request Error 400 Bad Request - wrong answer - `status` (integer, optional) - `message` (string, optional) - `path` (string, optional) ## Examples **Request** ```json { "phone": "254712345678", "questionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "answer": "Smith" } ``` **Response** ```json { "code": 200, "message": "New device registered successfully" } ``` **SDK Code** ```python Identity_verifyDeviceChangeSecurityAnswer_example import requests url = "http://localhost:8080/api/v3/auth/device-change/verify" payload = { "phone": "254712345678", "questionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "answer": "Smith" } headers = { "Authorization": "Bearer {{accessToken}}", "X-Device-Id": "e2e-device-1a2b3c4d", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Identity_verifyDeviceChangeSecurityAnswer_example const url = 'http://localhost:8080/api/v3/auth/device-change/verify'; const options = { method: 'POST', headers: { Authorization: 'Bearer {{accessToken}}', 'X-Device-Id': 'e2e-device-1a2b3c4d', 'Content-Type': 'application/json' }, body: '{"phone":"254712345678","questionId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","answer":"Smith"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Identity_verifyDeviceChangeSecurityAnswer_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "http://localhost:8080/api/v3/auth/device-change/verify" payload := strings.NewReader("{\n \"phone\": \"254712345678\",\n \"questionId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"answer\": \"Smith\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer {{accessToken}}") req.Header.Add("X-Device-Id", "e2e-device-1a2b3c4d") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Identity_verifyDeviceChangeSecurityAnswer_example require 'uri' require 'net/http' url = URI("http://localhost:8080/api/v3/auth/device-change/verify") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer {{accessToken}}' request["X-Device-Id"] = 'e2e-device-1a2b3c4d' request["Content-Type"] = 'application/json' request.body = "{\n \"phone\": \"254712345678\",\n \"questionId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"answer\": \"Smith\"\n}" response = http.request(request) puts response.read_body ``` ```java Identity_verifyDeviceChangeSecurityAnswer_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("http://localhost:8080/api/v3/auth/device-change/verify") .header("Authorization", "Bearer {{accessToken}}") .header("X-Device-Id", "e2e-device-1a2b3c4d") .header("Content-Type", "application/json") .body("{\n \"phone\": \"254712345678\",\n \"questionId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"answer\": \"Smith\"\n}") .asString(); ``` ```php Identity_verifyDeviceChangeSecurityAnswer_example request('POST', 'http://localhost:8080/api/v3/auth/device-change/verify', [ 'body' => '{ "phone": "254712345678", "questionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "answer": "Smith" }', 'headers' => [ 'Authorization' => 'Bearer {{accessToken}}', 'Content-Type' => 'application/json', 'X-Device-Id' => 'e2e-device-1a2b3c4d', ], ]); echo $response->getBody(); ``` ```csharp Identity_verifyDeviceChangeSecurityAnswer_example using RestSharp; var client = new RestClient("http://localhost:8080/api/v3/auth/device-change/verify"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer {{accessToken}}"); request.AddHeader("X-Device-Id", "e2e-device-1a2b3c4d"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"phone\": \"254712345678\",\n \"questionId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"answer\": \"Smith\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Identity_verifyDeviceChangeSecurityAnswer_example import Foundation let headers = [ "Authorization": "Bearer {{accessToken}}", "X-Device-Id": "e2e-device-1a2b3c4d", "Content-Type": "application/json" ] let parameters = [ "phone": "254712345678", "questionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "answer": "Smith" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v3/auth/device-change/verify")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```