Discussions
Undocumented error
So am trying to register users under an integrator and its gives a 404 error on unexpected moments, am sure the url and request method is correct. am using spring boot webclient, this is the code that makes the request.
private final WebClient client = WebClient.create("https://sandbox.spendjuice.com");
public Mono registerCardUser(String integratorId, CardUserRegistrationDTO registrationDTO, String token) {
return client.method(HttpMethod.POST)
.uri("/card-integrators/{integratorId}/register-user", integratorId)
.header("Authorization", "Bearer " + token)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.body(Mono.just(registrationDTO), CardUserRegistrationDTO.class)
.exchangeToMono(clientResponse -> {
if (!clientResponse.statusCode().is2xxSuccessful()) {
clientResponse.body((clientHttpResponse, context) -> clientHttpResponse.getBody());
}
return clientResponse.bodyToMono(Object.class);
})
.log("uri");
}
the request body
{
"first_name": "Aquinas",
"last_name": "Benedict",
"email": "godwinaquinas13775@gmail.com",
"id_number": "bvn_number",
"id_type": "BVN",
"phone_number": "+2438052972439",
"address": {
"country": "NGA",
"state": "Lagos",
"city": "Ikeja",
"line1": "Oshin Street Alausa",
"line2": "17",
"zip_code": "100001"
}
}