为某人提交入会申请(服务器端)
const url = 'https://api.vimine.network/v1/enroll';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"hello@example.com","first_name":"example","last_name":"example","codicefiscale":"example","codicefiscale_confirmed":true,"guardian":{"first_name":"example","last_name":"example","relation":"example","codicefiscale":"example","email":"hello@example.com","phone":"example"},"address":{"kind":"residence","line":"example","postal_code":"example","city":"example","province":"example","country":"IT"},"phone":"example","dob":"2026-04-15","gender":"M","birthplace":"example","birth_country":"example","membership_type":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","locale":"example","accept_statuto":{"version":1,"sha256":"example"},"privacy_notice":{"version":1,"sha256":"example","locale":"example"},"accept_terms":{"version":"example","sha256":"example"},"acknowledge_privacy":{"version":"example","sha256":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.vimine.network/v1/enroll \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "hello@example.com", "first_name": "example", "last_name": "example", "codicefiscale": "example", "codicefiscale_confirmed": true, "guardian": { "first_name": "example", "last_name": "example", "relation": "example", "codicefiscale": "example", "email": "hello@example.com", "phone": "example" }, "address": { "kind": "residence", "line": "example", "postal_code": "example", "city": "example", "province": "example", "country": "IT" }, "phone": "example", "dob": "2026-04-15", "gender": "M", "birthplace": "example", "birth_country": "example", "membership_type": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "locale": "example", "accept_statuto": { "version": 1, "sha256": "example" }, "privacy_notice": { "version": 1, "sha256": "example", "locale": "example" }, "accept_terms": { "version": "example", "sha256": "example" }, "acknowledge_privacy": { "version": "example", "sha256": "example" } }'地址为新地址时创建身份,并创建入会申请(无需审批的免费类型立即以 ACTIVE 签发,否则保持 PENDING,直到协会记录会费和/或予以批准)。已有 Vimine 账户的地址绝不会被悄悄关联:其所有者会收到一个确认链接,在其使用该链接时才会创建申请。始终返回 202。accept_statuto 必须指明现行章程的版本(已发布 sha256 时,还须指明 sha256)。仅限客户端令牌(enroll:write);接受 Idempotency-Key。
授权方式
章节“授权方式”请求体必填
章节“请求体必填”object
可选。识别一个人,要么通过税号,要么通过 dob + birthplace + birth_country——两者不能都没有(每缺少一项,就在该项上返回 422 required)。提供时会进行校验,并与姓名、出生日期和出生地比对(对于在国外出生的人,比对国家)
当事人确认一个与其个人信息不一致的税号(422 codicefiscale_mismatch 且 confirmable: true 时)
对未成年人(根据 dob 未满 18 岁)行使父母责任的人。若协会声明收集此信息块(aps.collects_guardian_data),则未成年人必须提供:否则在 guardian 上返回 422 required;仅在协会作此声明时才会保存
object
父母、监护人…,按协会的记录方式
可选;格式错误时会被拒绝
户籍地,或与之不同时的住所地。要么向每位会员询问,要么谁都不问:公开资料会说明协会的声明(member_address:none——忽略,不保存 · optional · required——缺少时在 address 上返回 422 required)
object
街道和门牌号
仅限意大利地址(两个字母);国外地址则舍弃
ISO 3166-1 alpha-2
仅用于统计:不参与比对
市镇(在意大利出生)或城市,自由文本(在国外出生)
ISO 3166-1 alpha-2
协会的会员卡类型之一(协会只有一种类型时可省略)
当事人所填写页面的语言(平台支持的语言——it、en、…;其他任何标签都会匹配到平台自己的语言:en-GB → en,zh-TW → zh-Hant)。它决定后续邮件的语言,并会成为新建账户的语言偏好;已有账户则保留自己的偏好。不支持的值会被忽略
当事人在您的网站上接受的现行章程(来自 GET /v1/aps/{slug})
object
当事人在您的网站上阅读的协会隐私声明(GET /v1/aps/{slug} → privacy_notice)。协会发布了隐私声明时必须提供;不是现行版本时返回 422 privacy_notice_outdated
object
所展示的隐私声明现行版本(GET /v1/aps/{slug} → privacy_notice)
您所展示的隐私声明的语言(即您从中读取它的那个响应里的 privacy_notice.locale)。每种语言都是一份独立的文件,有自己的版本:如果您用 ?locale= 读取资料,请指明该语言。默认依次为:请求的 locale、协会的语言
当事人在您的网站上接受的账户使用条款(platform_terms)——可选,必须指明现行版本
object
所展示的现行版本标签(GET /v1/legal/{kind})
其模板哈希(已发布时)
当事人阅读的平台隐私声明(platform_privacy)——可选,规则相同
object
所展示的现行版本标签(GET /v1/legal/{kind})
其模板哈希(已发布时)
响应
章节“响应”202
章节“202”已受理
object
示例
{ "status": "accepted"}400
章节“400”请求无效
object
object
示例自动生成
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}401
章节“401”缺少凭据或凭据无效
object
object
示例自动生成
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}403
章节“403”协会不接受入会申请(api_disabled)
404
章节“404”未找到
object
object
示例自动生成
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}422
章节“422”校验失败、会员卡类型未知,或 accept_statuto 指明的不是现行章程
429
章节“429”已触发速率限制
object
object
示例自动生成
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}500
章节“500”内部错误
object
object
示例自动生成
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "code": "example", "request_id": "example", "errors": [ { "field": "example", "code": "example", "message": "example" } ]}