I want a user to receive the invitation to an organization through his email, the problem is that the error 422, but I don't know what I have to modify in my object so that the Github Api can process the information.
@PostMapping("/add")
public Members postMembers() {
return webClientBuilder.build()
.post()
.uri(ADD_MEMBERS)
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
.header("Authorization", "Bearer " + TOKEN)
.retrieve()
.bodyToMono(Members.class)
.block();
}
POJO
public class Members {
private String org = "Escihu-Wizards";
private String email;
private String role = "direct_member";
public String getOrg() {
return org;
}
public void setOrg(String org) {
this.org = org;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
}