PageSourceSearch

https://docs.verifik.co/assets/js/0a158ee0.753be855.js

js verifik.co collected 2026-10-07 02:21:34 UTC 17,865 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkverifik_documentation=self.webpackChunkverifik_documentation||[]).push([["13991"],{56824(e,n,r){r.r(n),r.d(n,{metadata:()=>t,default:()=>p,frontMatter:()=>l,contentTitle:()=>d,toc:()=>h,assets:()=>c});var t=JSON.parse('{"id":"resources/phone-validations/validate-a-phone-validation","title":"Valider une Phone Validation","description":"V\xe9rifier un OTP t\xe9l\xe9phonique avec phone, countryCode et otp","source":"@site/docs-fr/resources/phone-validations/validate-a-phone-validation.mdx","sourceDirName":"resources/phone-validations","slug":"/resources/validate-a-phone-validation","permalink":"/verifik-fr/resources/validate-a-phone-validation","draft":false,"unlisted":false,"editUrl":"https://github.com/Open-Verifik/verifik-documentation/tree/main/docs-fr/resources/phone-validations/validate-a-phone-validation.mdx","tags":[],"version":"current","frontMatter":{"id":"validate-a-phone-validation","title":"Valider une Phone Validation","slug":"/resources/validate-a-phone-validation","description":"V\xe9rifier un OTP t\xe9l\xe9phonique avec phone, countryCode et otp","keywords":["v2/phone-validations","/v2/phone-validations","PUT v2/phone-validations","PUT /v2/phone-validations","phone-validations validate","api.verifik.co/v2/phone-validations","https://api.verifik.co/v2/phone-validations","otp verify phone"]},"sidebar":"tutorialSidebar","previous":{"title":"Lister toutes les Phone Validations","permalink":"/verifik-fr/resources/list-all-phone-validations"},"next":{"title":"Tarifs SMS et WhatsApp","permalink":"/verifik-fr/phone-validations/sms-and-whatsapp-prices"}}'),i=r(74848),s=r(28453),a=r(50773),o=r(57250);let l={id:"validate-a-phone-validation",title:"Valider une Phone Validation",slug:"/resources/validate-a-phone-validation",description:"V\xe9rifier un OTP t\xe9l\xe9phonique avec phone, countryCode et otp",keywords:["v2/phone-validations","/v2/phone-validations","PUT v2/phone-validations","PUT /v2/phone-validations","phone-validations validate","api.verifik.co/v2/phone-validations","https://api.verifik.co/v2/phone-validations","otp verify phone"]},d,c={},h=[{value:"Endpoint",id:"endpoint",level:3},{value:"Headers",id:"headers",level:3},{value:"Body parameters",id:"body-parameters",level:3},{value:"Exemples de requ\xeate",id:"exemples-de-requ\xeate",level:3},{value:"R\xe9ponse de succ\xe8s",id:"r\xe9ponse-de-succ\xe8s",level:3},{value:"Dur\xe9e de vie de l&#39;OTP",id:"dur\xe9e-de-vie-de-lotp",level:3},{value:"Tentatives OTP",id:"tentatives-otp",level:3},{value:"Erreurs courantes",id:"erreurs-courantes",level:3},{value:"Associ\xe9s",id:"associ\xe9s",level:3}];function u(e){let n={a:"a",admonition:"admonition",code:"code",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h3,{id:"endpoint",children:"Endpoint"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"PUT https://api.verifik.co/v2/phone-validations\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Confirme l'OTP re\xe7u par l'utilisateur. Verifik recherche la derni\xe8re Phone Validation ",(0,i.jsx)(n.strong,{children:"envoy\xe9e"})," (et non expir\xe9e) pour ce t\xe9l\xe9phone \u2014 y compris les enregistrements ",(0,i.jsx)(n.strong,{children:"manuels / Smart Tools"})," et ceux des flux de projet."]}),"\n",(0,i.jsx)(n.admonition,{title:"Associer \xe0 l'envoi",type:"tip",children:(0,i.jsxs)(n.p,{children:["Les OTP autonomes sont cr\xe9\xe9s avec ",(0,i.jsx)(n.a,{href:"/verifik-fr/resources/create-a-manual-phone-validation",children:(0,i.jsx)(n.code,{children:"POST /v2/phone-validations/manual"})}),". Les OTP d'app registration utilisent ",(0,i.jsx)(n.a,{href:"/verifik-fr/resources/phone-validations/create-an-app-registration-phone-validation",children:(0,i.jsx)(n.code,{children:"POST /v2/phone-validations/app-registration"})}),"."]})}),"\n",(0,i.jsx)(n.h3,{id:"headers",children:"Headers"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Name"}),(0,i.jsx)(n.th,{children:"Value"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Content-Type"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"application/json"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"Authorization"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"Bearer {YOUR_ACCESS_TOKEN}"})})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"body-parameters",children:"Body parameters"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Description"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"phone"})}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"M\xeame num\xe9ro national que lors de l'envoi de l'OTP."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"countryCode"})}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsxs)(n.td,{children:["Indicatif commen\xe7ant par ",(0,i.jsx)(n.code,{children:"+"}),"."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"otp"})}),(0,i.jsx)(n.td,{children:"number"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Code num\xe9rique re\xe7u par l'utilisateur."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"phoneGateway"})}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsxs)(n.td,{children:[(0,i.jsx)(n.code,{children:"sms"})," ou ",(0,i.jsx)(n.code,{children:"whatsapp"})," \u2014 affine la recherche lorsque les deux canaux ont \xe9t\xe9 utilis\xe9s."]})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"project"})}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"Filtre projet optionnel pour les enregistrements bas\xe9s sur un flux."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"projectFlow"})}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"Filtre project-flow optionnel (pr\xe9f\xe9r\xe9 lorsqu'il est disponible)."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"exemples-de-requ\xeate",children:"Exemples de requ\xeate"}),"\n",(0,i.jsxs)(a.A,{groupId:"language",children:[(0,i.jsx)(o.A,{value:"curl",label:"cURL",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:'curl -X PUT "https://api.verifik.co/v2/phone-validations" \\\n  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \\\n  -H "Content-Type: application/json" \\\n  -d \'{\n    "phone": "3001234567",\n    "countryCode": "+57",\n    "otp": 123456,\n    "phoneGateway": "whatsapp"\n  }\'\n'})})}),(0,i.jsx)(o.A,{value:"nodejs",label:"Node.js",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-javascript",children:'import axios from "axios";\n\nconst { data } = await axios.put(\n  "https://api.verifik.co/v2/phone-validations",\n  {\n    phone: "3001234567",\n    countryCode: "+57",\n    otp: 123456,\n    phoneGateway: "whatsapp",\n  },\n  {\n    headers: {\n      Authorization: "Bearer YOUR_ACCESS_TOKEN",\n      "Content-Type": "application/json",\n    },\n  }\n);\n\nconsole.log(data);\n'})})}),(0,i.jsx)(o.A,{value:"python",label:"Python",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-python",children:'import requests\n\nresponse = requests.put(\n    "https://api.verifik.co/v2/phone-validations",\n    headers={\n        "Authorization": "Bearer YOUR_ACCESS_TOKEN",\n        "Content-Type": "application/json",\n    },\n    json={\n        "phone": "3001234567",\n        "countryCode": "+57",\n        "otp": 123456,\n        "phoneGateway": "whatsapp",\n    },\n)\n\nprint(response.json())\n'})})}),(0,i.jsx)(o.A,{value:"php",label:"PHP",children:(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-php",children:"<?php\n\n$client = new \\GuzzleHttp\\Client();\n\n$response = $client->request('PUT', 'https://api.verifik.co/v2/phone-validations', [\n  'headers' => [\n    'Authorization' => 'Bearer YOUR_ACCESS_TOKEN',\n    'Content-Type' => 'application/json',\n  ],\n  'json' => [\n    'phone' => '3001234567',\n    'countryCode' => '+57',\n    'otp' => 123456,\n    'phoneGateway' => 'whatsapp',\n  ],\n]);\n\necho $response->getBody();\n"})})})]}),"\n",(0,i.jsx)(n.h3,{id:"r\xe9ponse-de-succ\xe8s",children:"R\xe9ponse de succ\xe8s"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n  "data": {\n    "_id": "66f0a1b2c3d4e5f678901234",\n    "status": "validated",\n    "countryCode": "+57",\n    "phone": "3001234567",\n    "phoneGateway": "whatsapp",\n    "source": "manual",\n    "validatedAt": "2026-07-29T22
1:40:00.000Z"\n  }\n}\n'})}),"\n",(0,i.jsx)(n.h3,{id:"dur\xe9e-de-vie-de-lotp",children:"Dur\xe9e de vie de l'OTP"}),"\n",(0,i.jsxs)(n.p,{children:["Les OTP en attente sont valides pendant ",(0,i.jsx)(n.strong,{children:"10 minutes"})," \xe0 partir du dernier envoi/renvoi r\xe9ussi (",(0,i.jsx)(n.code,{children:"expiresAt"})," dans la r\xe9ponse de cr\xe9ation). Apr\xe8s cela, cet endpoint renvoie ",(0,i.jsx)(n.code,{children:"412"})," ",(0,i.jsx)(n.code,{children:"phoneValidation_has_expired"}),". Envoyez un nouvel OTP (en respectant le d\xe9lai de renvoi d'environ 2 minutes, ou utilisez ",(0,i.jsx)(n.code,{children:"force: true"})," sur la cr\xe9ation manuelle) avant de demander \xe0 l'utilisateur de r\xe9essayer."]}),"\n",(0,i.jsx)(n.h3,{id:"tentatives-otp",children:"Tentatives OTP"}),"\n",(0,i.jsxs)(n.p,{children:["Il n'y a ",(0,i.jsx)(n.strong,{children:"aucune limite de tentatives c\xf4t\xe9 serveur"})," aujourd'hui. Les codes incorrects renvoient ",(0,i.jsx)(n.code,{children:"403"})," ",(0,i.jsx)(n.code,{children:"otp_does_not_match"})," jusqu'\xe0 l'expiration de l'enregistrement ou l'envoi d'un nouvel OTP. Appliquez un verrouillage ou un plafond de tentatives dans votre client si n\xe9cessaire."]}),"\n",(0,i.jsx)(n.h3,{id:"erreurs-courantes",children:"Erreurs courantes"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Status"}),(0,i.jsx)(n.th,{children:"Message"}),(0,i.jsx)(n.th,{children:"When"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"403"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"otp_does_not_match"})}),(0,i.jsx)(n.td,{children:"Le code ne correspond pas \xe0 l'OTP en attente."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"412"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"phoneValidation_has_expired"})}),(0,i.jsx)(n.td,{children:"Le TTL de l'OTP en attente (~10 minutes) est \xe9coul\xe9."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"409"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"otp_send_failed"})}),(0,i.jsx)(n.td,{children:"Le dernier enregistrement pour ce t\xe9l\xe9phone a \xe9chou\xe9 \xe0 l'envoi (diff\xe9rent de l'expiration)."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"409"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"phone_validation_already_validated"})}),(0,i.jsx)(n.td,{children:"L'OTP a d\xe9j\xe0 \xe9t\xe9 valid\xe9."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"404"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"phone_validation_not_found"})}),(0,i.jsx)(n.td,{children:"Aucune Phone Validation correspondante pour ce t\xe9l\xe9phone."})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"409"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"MissingParameter"})}),(0,i.jsx)(n.td,{children:"Champs de corps requis manquants."})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"associ\xe9s",children:"Associ\xe9s"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/verifik-fr/resources/create-a-manual-phone-validation",children:"Cr\xe9er une Phone Validation manuelle"})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/verifik-fr/resources/phone-validations",children:"Vue d'ensemble des Phone Validations"})}),"\n"]})]})}function p(e={}){let{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}},57250(e,n,r){r.d(n,{A:()=>o});var t=r(74848);r(96540);var i=r(34164),s=r(57663);function a({children:e,className:n,hidden:r}){return(0,t.jsx)("div",{role:"tabpanel",className:(0,i.A)("tabItem_Ymn6",n),hidden:r,children:e})}function o({children:e,className:n,value:r}){let{selectedValue:i,lazy:l}=(0,s.uc)(),d=r===i;return!d&&l?null:(0,t.jsx)(a,{className:n,hidden:!d,children:e})}},50773(e,n,r){r.d(n,{A:()=>u});var t=r(74848);r(96540);var i=r(34164),s=r(88287),a=r(57663),o=r(28584),l=r(19863);function d({className:e}){let{selectedValue:n,selectValue:r,tabValues:s,block:l}=(0,a.uc)(),c=[],{blockElementScrollPositionUntilNextRender:h}=(0,o.a_)(),u=e=>{let t=e.currentTarget,i=s[c.indexOf(t)].value;i!==n&&(h(t),r(i))},p=e=>{let n=null;switch(e.key){case"Enter":u(e);break;case"ArrowRight":{let r=c.indexOf(e.currentTarget)+1;n=c[r]??c[0];break}case"ArrowLeft":{let r=c.indexOf(e.currentTarget)-1;n=c[r]??c[c.length-1]}}n?.focus()};return(0,t.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.A)("tabs",{"tabs--block":l}
1,e),children:s.map(({value:e,label:r,attributes:s})=>(0,t.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{c.push(e)},onKeyDown:p,onClick:u,...s,className:(0,i.A)("tabs__item","tabItem_LNqP",s?.className,{"tabs__item--active":n===e}),children:r??e},e))})}function c({children:e}){return(0,t.jsx)("div",{className:"margin-top--md",children:e})}function h({className:e,children:n}){return(0,t.jsxs)("div",{className:(0,i.A)(s.G.tabs.container,"tabs-container","tabList__CuJ"),children:[(0,t.jsx)(d,{className:e}),(0,t.jsx)(c,{children:n})]})}function u(e){let n=(0,l.A)(),r=(0,a.OC)(e);return(0,t.jsx)(a.O_,{value:r,children:(0,t.jsx)(h,{className:e.className,children:(0,a.vT)(e.children)})},String(n))}},57663(e,n,r){r.d(n,{OC:()=>u,O_:()=>x,uc:()=>v,vT:()=>c});var t=r(74848),i=r(96540),s=r(56347),a=r(99989),o=r(96629),l=r(80618),d=r(41367);function c(e){return i.Children.toArray(e).filter(e=>"\n"!==e)}function h({value:e,tabValues:n}){return n.some(n=>n.value===e)}function u(e){let n,{defaultValue:r,queryString:t=!1,groupId:c}=e,u=function(e){let{values:n,children:r}=e;return(0,i.useMemo)(()=>{let e=n??i.Children.toArray(r).flatMap(e=>{if(!e)return[];if((0,i.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return[e];let n="string"==typeof e.type?e.type:e.type.name;throw Error(`Docusaurus error: Bad <Tabs> child <${n}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.
2If you do not want to pass on a "value" prop to the direct children of <Tabs>, you can also pass an explicit <Tabs values={...}> prop.`)}).map(({props:{value:e,label:n,attributes:r,default:t}})=>({value:e,label:n,attributes:r,default:t})),t=(0,l.XI)(e,(e,n)=>e.value===n.value);if(t.length>0)throw Error(`Docusaurus error: Duplicate values "${t.map(e=>`'${e.value}'`).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[n,r])}(e),[p,v]=(0,i.useState)(()=>(function({defaultValue:e,tabValues:n}){if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!h({value:e,tabValues:n}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${n.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}let r=n.find(e=>e.default)??n[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:r,tabValues:u})),[x,j]=function({queryString:e=!1,groupId:n}){let r=(0,s.W6)(),t=function({queryString:e=!1,groupId:n}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!n)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return n??null}({queryString:e,groupId:n});return[(0,o.aZ)(t),(0,i.useCallback)(e=>{if(!t)return;let n=new URLSearchParams(r.location.search);n.set(t,e),r.replace({...r.location,search:n.toString()})},[t,r])]}({queryString:t,groupId:c}),[f,m]=function({groupId:e}){let n=e?`docusaurus.tab.${e}`:null,[r,t]=(0,d.Dv)(n);return[r,(0,i.useCallback)(e=>{n&&t.set(e)},[n,t])]}({groupId:c}),b=h({value:n=x??f,tabValues:u})?n:null;return(0,a.A)(()=>{b&&v(b)},[b]),{selectedValue:p,selectValue:(0,i.useCallback)(e=>{if(!h({value:e,tabValues:u}))throw Error(`Can't select invalid tab value=${e}`);v(e),j(e),m(e)},[j,m,u]),tabValues:u,lazy:e.lazy??!1,block:e.block??!1}}let p=(0,i.createContext)(null);function v(){let e=i.useContext(p);if(!e)throw Error("useTabsContext() must be used within a Tabs component");return e}function x(e){return(0,t.jsx)(p.Provider,{value:e.value,children:e.children})}},28453(e,n,r){r.d(n,{R:()=>a,x:()=>o});var t=r(96540);let i={},s=t.createContext(i);function a(e){let n=t.useContext(s);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(s.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.