Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ошибка "Не задан ключ для подписи" при работе в проде #3

Open
spot62 opened this issue Jun 21, 2019 · 0 comments

Comments

@spot62
Copy link

spot62 commented Jun 21, 2019

Ошибка {"errors":["Не задан ключ для подписи"]} возникает из-за отсутствия поля key в запросе. Быстрое лечение, если key == inn

public class RequestBody {

    //Строка от 1 до 32 символов
    @SerializedName("Id")
    private String id;
    //Строка 12 символов
    @SerializedName("INN")
    private String inn;
    //Строка от 1 до 32 символов или null
    @SerializedName("Group")
    @Nullable private String group;
    //Строка 12 символов
    @SerializedName("key")
    private String key;
    //Структура Document
    @SerializedName("Content")
    private Document content;

    public RequestBody(String id, String inn, Document content) {
        this.id = id;
        this.inn = this.key = inn;
        this.content = content;
    }

    public RequestBody(String id, String inn, @Nullable String group, Document content) {
        this.id = id;
        this.inn = this.key = inn;
        this.group = group;
        this.content = content;
    }

    public String getId() {
        return id;
    }

    public String getInn() {
        return inn;
    }

    public String getGroup() {
        return group;
    }
    
    public String getKey() {
        return key;
    }

    public Document getContent() {
        return content;
    }

    public interface RequestService {
        @Headers("Content-Type: application/json; charset=utf-8")
        @POST("/api/v2/documents/")
        Call<Void> postDocument(@Header("X-Signature") String signature, @Body RequestBody requestBody);
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant