Comments (3)
Структура JSON не соответствует заявленной в документации.
Вот это лишнее, возможно из за этого и возникает ошибка:
"doctype": 12, "doc_id": 157, "parent_id": 157, "created": 1497077049611, "docbody_id": 157, "updated": 1497077049611
У меня такая структура. и все работает на ура:
{ "name":"КНП „Перший Черкаський міський центр первинної медико-санітарної допомоги”", "short_name":"КНП „Перший Черкаський міський ЦПМСД”", "public_name":"КНП „Перший Черкаський міський центр первинної медико-санітарної допомоги”", "type":"MSP", "owner_property_type":"PRIVATE", "legal_form":"150", "edrpou":"38469862", "email":"[email protected]", "kveds":[ "86.10" ], "addresses":[ { "type":"REGISTRATION", "country":"UA", "area":"Черкаська область", "region":"Черкаська область", "settlement":"Черкаси", "settlement_type":"CITY", "settlement_id":"43432432", "street_type":"STREET", "street":"Дахнівська", "building":"34" }, { "type":"RESIDENCE", "country":"UA", "area":"Черкаська область", "region":"Черкаська область", "settlement":"Черкаси", "settlement_type":"CITY", "settlement_id":"43432432", "street_type":"STREET", "street":"Дахнівська", "building":"34" } ], "phones":[ { "type":"LAND_LINE", "number":"+380674023650" } ], "owner":{ "first_name":"First", "last_name":"Last", "second_name":"Second", "tax_id":"1111111111", "birth_date":"1982-12-12", "birth_place":"birth_place", "gender":"MALE", "email":"[email protected]", "position":"P3", "documents":[ { "type":"PASSPORT", "number":"111" } ], "phones":[ { "type":"LAND_LINE", "number":"+380674023650" } ] }, "medical_service_provider":{ "licenses":[ { "license_number":"Lic", "issued_by":"issued_by", "issued_date":"2014-01-01", "expiry_date":"2020-01-01", "active_from_date":"2020-01-01", "what_licensed":"what_licensed" }, { "license_number":"Lic2", "issued_by":"issued_by2", "issued_date":"2014-01-02", "expiry_date":"2020-01-02", "active_from_date":"2020-01-02", "what_licensed":"what_licensed2" } ], "accreditation":{ "category":"FIRST", "issued_date":"2014-01-03", "expiry_date":"2020-01-03", "order_no":"1235we", "order_date":"2020-01-03" } }, "security":{ "redirect_uri":"https:\/\/google.com.ua" }, "public_offer":{ "consent":true, "consent_text":"consent_text" } }
from api-spec.
@romanm доброго времени суток!
Проверьте сериализацию JSON'а.
Данные которые вы подписываете выглядят следующим образом:
\ufeff{\n\t\"name\": \"Hello World! - Клініка Адоніс 123\",\n\t\"short_name\": \"Адоніс\",\n\t\"public_name\": \"Адоніс\",\n\t\"type\": \"MSP\",\n\t\"owner_property_type\": \"STATE\",\n\t\"legal_form\": \"140\",\n\t\"edrpou\": \"1560503515\",\n\t\"kveds\": [\n\t\t\"86.10\"\n\t],\n\t\"addresses\": [\n\t\t{\n\t\t\t\"type\": \"RESIDENCE\",\n\t\t\t\"country\": \"UA\",\n\t\t\t\"area\": \"Житомирська\",\n\t\t\t\"region\": \"Бердичівський\",\n\t\t\t\"settlement\": \"Київ\",\n\t\t\t\"settlement_type\": \"CITY\",\n\t\t\t\"settlement_id\": \"43432432\",\n\t\t\t\"street_type\": \"STREET\",\n\t\t\t\"street\": \"вул. Ніжинська\",\n\t\t\t\"building\": \"15\",\n\t\t\t\"apartment\": \"23\",\n\t\t\t\"zip\": \"02090\"\n\t\t}\n\t],\n\t\"phones\": [\n\t\t{\n\t\t\t\"type\": \"MOBILE\",\n\t\t\t\"number\": \"+380503410870\"\n\t\t}\n\t],\n\t\"email\": \"[email protected]\",\n\t\"owner\": {\n\t\t\"first_name\": \"Петро\",\n\t\t\"last_name\": \"Іванов\",\n\t\t\"second_name\": \"Миколайович\",\n\t\t\"tax_id\": \"3015492565\",\n\t\t\"birth_date\": \"1991-08-19\",\n\t\t\"birth_place\": \"Вінниця, Україна\",\n\t\t\"gender\": \"MALE\",\n\t\t\"email\": \"[email protected]\",\n\t\t\"documents\": [\n\t\t\t{\n\t\t\t\t\"type\": \"PASSPORT\",\n\t\t\t\t\"number\": \"120518\"\n\t\t\t}\n\t\t],\n\t\t\"phones\": [\n\t\t\t{\n\t\t\t\t\"type\": \"MOBILE\",\n\t\t\t\t\"number\": \"+380503410870\"\n\t\t\t}\n\t\t],\n\t\t\"position\": \"Голова правління\"\n\t},\n\t\"medical_service_provider\": {\n\t\t\"licenses\": [\n\t\t\t{\n\t\t\t\t\"license_number\": \"fd123443\",\n\t\t\t\t\"issued_by\": \"Кваліфікацйна комісія\",\n\t\t\t\t\"issued_date\": \"1991-08-19\",\n\t\t\t\t\"expiry_date\": \"1991-08-19\",\n\t\t\t\t\"kved\": \"86.10\",\n\t\t\t\t\"what_licensed\": \"реалізація наркотичних засобів\"\n\t\t\t}\n\t\t],\n\t\t\"accreditation\": {\n\t\t\t\"category\": \"FIRST\",\n\t\t\t\"issued_date\": \"1991-08-19\",\n\t\t\t\"expiry_date\": \"1991-08-19\",\n\t\t\t\"order_no\": \"fd123443\",\n\t\t\t\"order_date\": \"1991-08-19\"\n\t\t}\n\t},\n\t\"security\": {\n\t\t\"redirect_uri\": \"redirect_uri\"\n\t},\n\t\"public_offer\": {\n\t\t\"consent\": true,\n\t\t\"consent_text\": \"Consent text\"\n\t},\n\t\"doctype\": 12,\n\t\"doc_id\": 157,\n\t\"parent_id\": 157,\n\t\"created\": 1497077049611,\n\t\"docbody_id\": 157,\n\t\"updated\": 1497077049611\n}
Переносы и табуляция скорей всего пройдут, но как минимум \ufeff
необходимо убрать.
http://www.charbase.com/feff-unicode-zero-width-no-break-space
from api-spec.
Дійсно символ \ufeff був винний, який створювався FileSaver.saveAs .
До того всього він ще і не видимий.
Можна обійтись і без нього
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
a.download = this.registryMspFileName();
var dataJson = $scope.api__legal_entities;
['doc_id','doctype','parent_id','created','docbody_id','updated'].forEach(function(k){
delete dataJson[k]
});
var json = JSON.stringify(dataJson),
blob = new Blob([json], {type: "octet/stream"}),
url = window.URL.createObjectURL(blob);
a.href = url;
a.click();
window.URL.revokeObjectURL(url);
Дякую всім за допомогу.
from api-spec.
Related Issues (20)
- ДЕМО Update Contract Employees. HOT 2
- При обновлении контракта возникает ошибка 409 request_conflict HOT 3
- Не валидируется причина удаления заявки на договор
- Scope issue for nhs_verify and divisions methods HOT 1
- DEMO: Возвращаются invalid или expired access_token при обмене Code Grant на Access Token HOT 5
- PROD Великі затримкі із доставкою СМС HOT 1
- 500 Create/Update Legal Entity
- DEMO Не отправляется смс с кодом верификации HOT 4
- GET employee_request by id
- DEMO: Не удаётся подписать Declaration Request HOT 3
- Замінити інформацію МІС "Health24" в розділі providers | Портал
- Не вдається авторизуватися на демо
- Не работают PreProd NHS tokens for contract testing
- Замінити інформацію МІС "Облік медичних кадрів України та пацієнтів" в розділі providers | Портал HOT 1
- Переведення існуючих декларацій на нове місце роботи. HOT 2
- Create/Update Legal Entity
- Ошибка авторизации десктопного приложения в демо среде
- Api free account
- Помилка авторизації в систему E-Health HOT 1
- GET Permission on scope in EHealth
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-spec.