{"id":488,"date":"2019-08-10T11:36:38","date_gmt":"2019-08-10T11:36:38","guid":{"rendered":"https:\/\/help.unitedover.com\/digits\/?post_type=manual_kb&#038;p=488"},"modified":"2024-08-05T19:31:49","modified_gmt":"2024-08-05T19:31:49","slug":"rest-api","status":"publish","type":"manual_kb","link":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/","title":{"rendered":"REST API"},"content":{"rendered":"\n<p> This addon for <a aria-label=\" (opens in a new tab)\" href=\"https:\/\/digits.unitedover.com\" target=\"_blank\" rel=\"noreferrer noopener\">Digits<\/a> provides the functionality of login\/signup using mobile phone numbers to your WordPress site using REST API. <\/p>\n\n\n\n<p>Check our Postman API Samples from <a href=\"https:\/\/documenter.getpostman.com\/view\/37319001\/2sA3kbhK2q\">here<\/a>.<br>(<a href=\"https:\/\/documenter.getpostman.com\/view\/37319001\/2sA3kbhK2q\">https:\/\/documenter.getpostman.com\/view\/37319001\/2sA3kbhK2q<\/a>)<\/p>\n\n\n<h3><strong>Authentication<\/strong><\/h3>\n<p>The API is token-based as its more secure than the conventional method. Also since it does not use credentials, you can restrict access anytime.<\/p>\n<p><strong>Access Token<\/strong> is a token that can be sent used as a replacement for user credentials for further requests. To authenticate with an access token, the request needs to be sent with header<\/p>\n<p><code><strong>Authorization<\/strong>: Bearer access_token<\/code><\/p>\n<p><em>Note: you will need to re-request access token if the user has changed his password.<br \/><\/em><\/p>\n<p><strong>Access Token Validity<br \/><\/strong>If an Access token is not used for more than 14 days it will expire, then you\u2019ll need to request the token again. You can even change the expiry from REST API addon settings. If the token gets expired you\u2019ll get the below error with 401 HTTP error code<\/p>\n<div class=\"res-fail\">{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;error&#8221;:&#8221;token_expired&#8221;,&#8221;message&#8221;:&#8221;Your session has expired. Please login again&#8221;}}<\/div>\n<p>If authorization fails, it will return 401 HTTP code<\/p>\n<div class=\"res-fail\">{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;error&#8221;:&#8221;invalid_token&#8221;,&#8221;message&#8221;:&#8221;Invalid Token&#8221;}}<\/div>\n<p>If authentication is not working you will need to add this to your .htaccess<\/p>\n<pre>RewriteEngine On\nRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]<\/pre>\n<p>You will also need to add this to httpd.conf<\/p>\n<pre>SetEnvIf Authorization \"(.*)\" HTTP_AUTHORIZATION=$1<\/pre>\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>NOTE: The request should be sent as POST Parameters in Body<\/strong><\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"if-using-firebase-gateway\">If using Firebase Gateway<\/h4>\n\n\n\n<p>You&#8217;ll also need to add their native libraries to send OTP as we will verify them with tokens.<br><br>You can verify if your token is correct or not here <a href=\"https:\/\/jwt.io\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">https:\/\/jwt.io\/<\/a><br><br>For more information visit: <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens#retrieve_id_tokens_on_clients\" target=\"_blank\">https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens#retrieve_id_tokens_on_clients<\/a><\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"flow-chart\">Flow Chart<\/h3>\n\n\n\n<div class=\"mxgraph\" style=\"max-width:100%;border:1px solid transparent;\" data-mxgraph=\"{&quot;highlight&quot;:&quot;#0000ff&quot;,&quot;lightbox&quot;:false,&quot;nav&quot;:true,&quot;resize&quot;:true,&quot;toolbar&quot;:&quot;zoom&quot;,&quot;xml&quot;:&quot;&lt;mxfile host=\\&quot;app.diagrams.net\\&quot; modified=\\&quot;2024-05-02T19:56:14.851Z\\&quot; agent=\\&quot;Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/124.0.0.0 Safari\/537.36 Edg\/124.0.0.0\\&quot; etag=\\&quot;MFZSKmU69qE7TozSX9kv\\&quot; version=\\&quot;24.3.1\\&quot;&gt;\\n  &lt;diagram id=\\&quot;AWAGwh4fllBw4FH1eajD\\&quot; name=\\&quot;Page-1\\&quot;&gt;\\n    &lt;mxGraphModel dx=\\&quot;2426\\&quot; dy=\\&quot;1544\\&quot; grid=\\&quot;1\\&quot; gridSize=\\&quot;10\\&quot; guides=\\&quot;1\\&quot; tooltips=\\&quot;1\\&quot; connect=\\&quot;1\\&quot; arrows=\\&quot;1\\&quot; fold=\\&quot;1\\&quot; page=\\&quot;1\\&quot; pageScale=\\&quot;1\\&quot; pageWidth=\\&quot;1600\\&quot; pageHeight=\\&quot;1200\\&quot; math=\\&quot;0\\&quot; shadow=\\&quot;0\\&quot;&gt;\\n      &lt;root&gt;\\n        &lt;mxCell id=\\&quot;0\\&quot; \/&gt;\\n        &lt;mxCell id=\\&quot;1\\&quot; parent=\\&quot;0\\&quot; \/&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-21\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=18;endArrow=none;endFill=0;comic=0;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-4\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-9\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;795\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;535\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-22\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=18;entryX=0.5;entryY=0;entryDx=0;entryDy=0;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-4\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-10\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;mxPoint x=\\&quot;780\\&quot; y=\\&quot;200\\&quot; as=\\&quot;targetPoint\\&quot; \/&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;795\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;1065\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-4\\&quot; value=\\&quot;Register\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;715\\&quot; y=\\&quot;50\\&quot; width=\\&quot;160\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-19\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeWidth=3;fontSize=18;endArrow=none;endFill=0;startArrow=none;startFill=0;strokeColor=#B8C2D4;jumpStyle=none;jumpSize=6;shadow=0;comic=0;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-7\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-9\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;390\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;535\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-20\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=18;exitX=0.5;exitY=1;exitDx=0;exitDy=0;endArrow=none;endFill=0;comic=0;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-7\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-10\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;390\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;1065\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-7\\&quot; value=\\&quot;Login&amp;amp;nbsp;\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;310\\&quot; y=\\&quot;50\\&quot; width=\\&quot;160\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-23\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=18;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-8\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-10\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;1200\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;1065\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-24\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=18;rounded=1;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-8\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-9\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;1200\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;535\\&quot; y=\\&quot;150\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-8\\&quot; value=\\&quot;Forgot Password\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;1120\\&quot; y=\\&quot;60\\&quot; width=\\&quot;160\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-42\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-9\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-40\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;535\\&quot; y=\\&quot;810\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;800\\&quot; y=\\&quot;810\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-9\\&quot; value=\\&quot;Without Phone Number\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;430\\&quot; y=\\&quot;220\\&quot; width=\\&quot;210\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-27\\&quot; style=\\&quot;edgeStyle=none;curved=1;comic=1;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-10\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-26\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-10\\&quot; value=\\&quot;With Phone Number\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;960\\&quot; y=\\&quot;220\\&quot; width=\\&quot;210\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-30\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-26\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-29\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-38\\&quot; style=\\&quot;edgeStyle=none;curved=1;comic=1;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-26\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-35\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-26\\&quot; value=\\&quot;Endpoint: Send OTP\\&quot; style=\\&quot;rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;strokeWidth=1;fontSize=19;arcSize=50;glass=0;comic=0;shadow=0;strokeColor=none;fillColor=#fbfbfb;fontColor=#404e63;fontStyle=1\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;945\\&quot; y=\\&quot;350\\&quot; width=\\&quot;240\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-37\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-29\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-35\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-29\\&quot; value=\\&quot;Use Firebase Native Library to send OTP\\&quot; style=\\&quot;rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;strokeWidth=1;fontSize=19;arcSize=50;glass=0;comic=0;shadow=0;strokeColor=none;fillColor=#fbfbfb;fontColor=#404e63;fontStyle=1\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;1085\\&quot; y=\\&quot;460\\&quot; width=\\&quot;230\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-34\\&quot; value=\\&quot;if firebase=1\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=16;fontColor=#404e63;rotation=0;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;1090\\&quot; y=\\&quot;411\\&quot; width=\\&quot;100\\&quot; height=\\&quot;20\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-39\\&quot; style=\\&quot;edgeStyle=none;curved=1;comic=1;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-35\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-36\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-35\\&quot; value=\\&quot;Get OTP from user\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;960\\&quot; y=\\&quot;570\\&quot; width=\\&quot;210\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-41\\&quot; style=\\&quot;edgeStyle=orthogonalEdgeStyle;comic=0;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-36\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-40\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot;&gt;\\n            &lt;Array as=\\&quot;points\\&quot;&gt;\\n              &lt;mxPoint x=\\&quot;1065\\&quot; y=\\&quot;810\\&quot; \/&gt;\\n              &lt;mxPoint x=\\&quot;800\\&quot; y=\\&quot;810\\&quot; \/&gt;\\n            &lt;\/Array&gt;\\n          &lt;\/mxGeometry&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-36\\&quot; value=\\&quot;Endpoint: Verify OTP\\&quot; style=\\&quot;rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;strokeWidth=1;fontSize=19;arcSize=50;glass=0;comic=0;shadow=0;strokeColor=none;fillColor=#fbfbfb;fontColor=#404e63;fontStyle=1\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;945\\&quot; y=\\&quot;700\\&quot; width=\\&quot;240\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-46\\&quot; style=\\&quot;edgeStyle=none;curved=1;comic=1;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-40\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-44\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-40\\&quot; value=\\&quot;Endpoint: Login\/Register\/Forgot Password\\&quot; style=\\&quot;rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;strokeWidth=1;fontSize=19;arcSize=50;glass=0;comic=0;shadow=0;strokeColor=none;fillColor=#fbfbfb;fontColor=#404e63;fontStyle=1\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;590\\&quot; y=\\&quot;880\\&quot; width=\\&quot;420\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-43\\&quot; value=\\&quot;if verified\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=16;fontColor=#404e63;rotation=0;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;880\\&quot; y=\\&quot;811\\&quot; width=\\&quot;100\\&quot; height=\\&quot;20\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-47\\&quot; style=\\&quot;edgeStyle=none;curved=1;comic=1;jumpStyle=none;jumpSize=6;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shadow=0;startArrow=none;startFill=0;endArrow=none;endFill=0;strokeColor=#B8C2D4;strokeWidth=3;fillColor=#808080;fontSize=16;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; source=\\&quot;ldCEmyJj2IBXto5R3AXq-44\\&quot; target=\\&quot;ldCEmyJj2IBXto5R3AXq-45\\&quot; edge=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry relative=\\&quot;1\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-44\\&quot; value=\\&quot;Get Auth Code\\&quot; style=\\&quot;text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;strokeWidth=1;fontSize=19;fontColor=#404e63;\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;695\\&quot; y=\\&quot;1000\\&quot; width=\\&quot;210\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n        &lt;mxCell id=\\&quot;ldCEmyJj2IBXto5R3AXq-45\\&quot; value=\\&quot;Login User using Auth Code\\&quot; style=\\&quot;rounded=1;whiteSpace=wrap;html=1;labelBackgroundColor=none;strokeWidth=1;fontSize=19;arcSize=50;glass=0;comic=0;shadow=0;strokeColor=none;fillColor=#fbfbfb;fontColor=#404e63;fontStyle=1\\&quot; parent=\\&quot;1\\&quot; vertex=\\&quot;1\\&quot;&gt;\\n          &lt;mxGeometry x=\\&quot;640\\&quot; y=\\&quot;1120\\&quot; width=\\&quot;320\\&quot; height=\\&quot;50\\&quot; as=\\&quot;geometry\\&quot; \/&gt;\\n        &lt;\/mxCell&gt;\\n      &lt;\/root&gt;\\n    &lt;\/mxGraphModel&gt;\\n  &lt;\/diagram&gt;\\n&lt;\/mxfile&gt;\\n&quot;}\"><\/div>\n<script type=\"text\/javascript\" src=\"https:\/\/viewer.diagrams.net\/js\/viewer-static.min.js\"><\/script>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n<h3><strong>Registration<\/strong><\/h3>\n<h5><strong>Endpoint: wp-json\/digits\/v1\/create_user<\/strong><\/h5>\n<h4>Parameters<\/h4>\n<table class=\"rest-param\" style=\"width: 100%; height: 293px;\">\n<tbody>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_name<\/td>\n<td style=\"height: 27px;\">First Name<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_countrycode<\/td>\n<td style=\"height: 27px;\">Country Code (with + symbol)<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_mobile<\/td>\n<td style=\"height: 27px;\">Mobile Phone Number<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_password<\/td>\n<td style=\"height: 27px;\">Password<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_username<\/td>\n<td style=\"height: 27px;\">Username<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">digits_reg_email<\/td>\n<td style=\"height: 27px;\">Email<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">otp<\/td>\n<td style=\"height: 27px;\">One Time Passcode<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">ftoken<\/td>\n<td style=\"height: 27px;\"><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> if using Firebase Gateway<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">code<\/td>\n<td style=\"height: 27px;\">AccountKit authorization code if using Account Kit Gateway<\/td>\n<\/tr>\n<tr style=\"height: 50px;\">\n<td style=\"height: 50px;\">digits_reg_{{meta_key}}<\/td>\n<td style=\"height: 50px;\">Digits Custom Field Meta (Remove all special characters from meta key for eg: a-b_c becomes abc)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\"><span class=\"res-msg\">Success<\/span><br \/>{&#8220;success&#8221;:true,&#8221;data&#8221;:{&#8220;user_id&#8221;:&#8221;user_id&#8221;,&#8221;access_token&#8221;:&#8221;Access Token&#8221;,&#8221;token_type&#8221;:&#8221;bearer&#8221;}}\n<p class=\"res-notice\">You can use this authentication token to authenticate user (See <a href=\"#authentication\">Authentication section<\/a> for more details)<\/p>\n<\/div>\n<div class=\"res-fail\"><span class=\"res-msg\">Failure<\/span><br \/>{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;code&#8221;:&#8221;-1&#8243;,&#8221;msg&#8221;:&#8221;Error Message&#8221;}}<\/div>\n<div>\u00a0<\/div>\n<h3><strong><br \/>Login<\/strong><\/h3>\n<h5><strong>Endpoint: wp-json\/digits\/v1\/login_user<\/strong><\/h5>\n<h4>Parameters<\/h4>\n<table class=\"rest-param\" style=\"width: 100%; height: 138px;\">\n<tbody>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">user<\/td>\n<td style=\"height: 23px;\">User&#8217;s Phone Number \/ Email \/ Username (not needed with Account Kit)<\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">countrycode<\/td>\n<td style=\"height: 23px;\">Country code of Phone (with + symbol) <em>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">password<\/td>\n<td style=\"height: 23px;\">User&#8217;s Password (not required if using OTP)<\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">otp<\/td>\n<td style=\"height: 23px;\">One Time Passcode<\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">ftoken<\/td>\n<td style=\"height: 23px;\"><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> if using Firebase Gateway<\/td>\n<\/tr>\n<tr style=\"height: 23px;\">\n<td style=\"height: 23px;\">code<\/td>\n<td style=\"height: 23px;\">AccountKit authorization code if using Account Kit Gateway<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\"><span class=\"res-msg\">Success<\/span><br \/>{&#8220;success&#8221;:true,&#8221;data&#8221;:{&#8220;user_id&#8221;:&#8221;user_id&#8221;,&#8221;access_token&#8221;:&#8221;Access Token&#8221;,&#8221;token_type&#8221;:&#8221;bearer&#8221;}}\n<p class=\"res-notice\">You can use this authentication token to authenticate user (See <a href=\"#authentication\">Authentication section<\/a> for more details)<\/p>\n<\/div>\n<div class=\"res-fail\"><span class=\"res-msg\">Failure<\/span><br \/>{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;code&#8221;:&#8221;-1&#8243;,&#8221;msg&#8221;:&#8221;Error Message&#8221;}}<\/div>\n<div>\u00a0<\/div>\n<h3><strong><br \/>Forgot Password<\/strong><\/h3>\n<h5><strong>Endpoint: wp-json\/digits\/v1\/recovery<\/strong><\/h5>\n<p>This can be used to reset password using email and mobile phone number both. If email is used in &#8220;user&#8221; parameter then an email with link will be sent to user for password change.<br \/>If phone number is used in &#8220;user&#8221; parameter then it will require OTP to proceed with password change request<\/p>\n<h4>Parameters<\/h4>\n<table class=\"rest-param\" style=\"width: 100%; height: 231px;\">\n<tbody>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">user<\/td>\n<td style=\"height: 27px;\">User&#8217;s Phone Number \/ Email \/ Username<\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">countrycode<\/td>\n<td style=\"height: 27px;\">Country code of Phone (with + symbol) <em>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<tr style=\"height: 50px;\">\n<td style=\"height: 50px;\">otp<\/td>\n<td style=\"height: 50px;\">One Time Passcode<em><br \/>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<tr style=\"height: 50px;\">\n<td style=\"height: 50px;\">ftoken<\/td>\n<td style=\"height: 50px;\"><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> if using Firebase Gateway<br \/><em>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<tr style=\"height: 50px;\">\n<td style=\"height: 50px;\">code<\/td>\n<td style=\"height: 50px;\">AccountKit authorization code if using Account Kit<br \/><em>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<tr style=\"height: 27px;\">\n<td style=\"height: 27px;\">password<\/td>\n<td style=\"height: 27px;\">User&#8217;s New Password <em>(only needed if value of &#8220;user&#8221; is phone number)<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\"><span class=\"res-msg\">Success<\/span><br \/>{&#8220;success&#8221;:true,&#8221;data&#8221;:{&#8220;user_id&#8221;:&#8221;user_id&#8221;,&#8221;access_token&#8221;:&#8221;Access Token&#8221;,&#8221;token_type&#8221;:&#8221;bearer&#8221;}}\n<p class=\"res-notice\">You can use this authentication token to authenticate user (See <a href=\"#authentication\">Authentication section<\/a> for more details)<\/p>\n<\/div>\n<div class=\"res-fail\"><span class=\"res-msg\">Failure<\/span><br \/>{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;code&#8221;:&#8221;-1&#8243;,&#8221;msg&#8221;:&#8221;Error Message&#8221;}}<\/div>\n<div>\u00a0<\/div>\n<h3><strong><br \/>Logout<\/strong><\/h3>\n<h5><strong>Endpoint:\u00a0 wp-json\/digits\/v1\/logout<\/strong><\/h5>\n<p>This request should be sent with Access Token to expire the Access Token. (Read <a href=\"#authentication\">Authentication section<\/a> for more about Access Token)<\/p>\n<h4>Response<\/h4>\n<div class=\"res-suc\">Success<br \/>{&#8220;success&#8221;:true}<\/div>\n<div class=\"res-fail\">Failure<br \/>{&#8220;success&#8221;:false}<\/div>\n<h3><strong><br \/>Update Mobile Phone Number<\/strong><\/h3>\n<h5><strong>Endpoint: wp-json\/digits\/v1\/update_phone<\/strong><\/h5>\n<p>This request should be sent with Access Token. (Read <a href=\"#authentication\">Authentication section<\/a> for more about Access Token)<\/p>\n<h4>Parameters (All Required)<\/h4>\n<table class=\"rest-param\" style=\"height: 130px;\" width=\"467\">\n<tbody>\n<tr>\n<td>countrycode<\/td>\n<td>User&#8217;s Phone number country code (with + symbol)<\/td>\n<\/tr>\n<tr>\n<td>mobileNo<\/td>\n<td>User&#8217;s New Phone number<\/td>\n<\/tr>\n<tr>\n<td>whatsapp<\/td>\n<td>1 (only if whatsapp is being used)<\/td>\n<\/tr>\n<tr>\n<td>otp<\/td>\n<td>One Time Passcode (for verify_otp)(only if value of user is phone number)<\/td>\n<\/tr>\n<tr>\n<td>ftoken<\/td>\n<td><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> (for verify_otp)(only needed if value of \u201cuser\u201d is phone number, for Firebase)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\">Success<br \/>{&#8220;success&#8221;:true}<\/div>\n<div class=\"res-fail\">Failure<br \/>{\u201csuccess\u201d:false,\u201ddata\u201d:{\u201dmsg\u201d:\u201dError Message\u201d}}<\/div>\n<h3><strong>OTP<\/strong><\/h3>\n<h4><strong>Send OTP &amp; Resend OTP<\/strong><\/h4>\n<h5><strong>Send OTP endpoint: wp-json\/digits\/v1\/send_otp<\/strong><\/h5>\n<h5><strong>Resend OTP endpoint: wp-json\/digits\/v1\/resend_otp<\/strong><\/h5>\n<h4>Parameters<\/h4>\n<table class=\"rest-param\" style=\"height: 130px;\" width=\"467\">\n<tbody>\n<tr>\n<td>countrycode<\/td>\n<td>User&#8217;s Phone number country code (with + symbol)<\/td>\n<\/tr>\n<tr>\n<td>mobileNo<\/td>\n<td>User&#8217;s Phone number<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>login <em>(if the action is login)<\/em><br \/>register <em>(if the action is registration)<\/em><br \/>resetpass <em>(if the action is reset password)<\/em><br \/>update <em>(if the action is update phone)<\/em><\/td>\n<\/tr>\n<tr>\n<td>whatsapp<\/td>\n<td>1 (only if whatsapp is being used)<\/td>\n<\/tr>\n<tr>\n<td>username (optional)<\/td>\n<td>(for send_otp and type = register) if you want to validate and check if user exists with username before sending OTP<\/td>\n<\/tr>\n<tr>\n<td>email (optional)<\/td>\n<td>(for send_otp and type = register) if you want to validate and check if user exists with email before sending OTP<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4><strong><br \/>Verify OTP<\/strong><\/h4>\n<h5><strong>Verify OTP endpint: wp-json\/digits\/v1\/verify_otp<\/strong><\/h5>\n<h4>Parameters (All Required)<\/h4>\n<table class=\"rest-param\" style=\"height: 130px;\" width=\"467\">\n<tbody>\n<tr>\n<td>countrycode<\/td>\n<td>User&#8217;s Phone number country code (with + symbol)<\/td>\n<\/tr>\n<tr>\n<td>mobileNo<\/td>\n<td>User&#8217;s Phone number<\/td>\n<\/tr>\n<tr>\n<td>type<\/td>\n<td>login <em>(if the action is login)<\/em><br \/>register <em>(if the action is registration)<\/em><br \/>resetpass <em>(if the action is reset password)<\/em><br \/>update <em>(if the action is update phone)<\/em><\/td>\n<\/tr>\n<tr>\n<td>whatsapp<\/td>\n<td>1 (only if whatsapp is being used)<\/td>\n<\/tr>\n<tr>\n<td>otp<\/td>\n<td>One Time Passcode (only if value of user is phone number)<\/td>\n<\/tr>\n<tr>\n<td>ftoken<\/td>\n<td><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> (only needed if value of \u201cuser\u201d is phone number, for Firebase)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\"><span class=\"res-msg\">Success<\/span><br \/>{&#8220;accountkit&#8221;:0,&#8221;firebase&#8221;:0,&#8221;code&#8221;:&#8221;1&#8243;}\n<p class=\"res-notice\"><em>If accountkit is 1, then you need to use account kit for verification<\/em><br \/><em>If firebase is 1, then you need to use firebase for verification<\/em><br \/><em>If code is 1, then it\u2019s a success<\/em><\/p>\n<\/div>\n<div class=\"res-fail\"><span class=\"res-msg\">Failure<\/span><br \/>{&#8220;code&#8221;:&#8221;-11&#8243;,&#8221;message&#8221;:&#8221;Error Message&#8221;}<\/div>\n<h3><strong><br \/>One Click Login\/Signup<\/strong><\/h3>\n<h5><strong>Endpoint: wp-json\/digits\/v1\/one_click<\/strong><\/h5>\n<p>This requires <a href=\"https:\/\/digits.unitedover.com\/addon\/one-click-login-signup\/\" target=\"_blank\" rel=\"noopener noreferrer\">One Click Login\/Signup Addon<\/a> to work<\/p>\n<p>Also, if you are using Firebase then you first need to get the <a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Ftoken<\/a> using Firebase&#8217;s SDK and if you are using any other Gateway then you first need to call<strong> wp-json\/digits\/v1\/send_otp <\/strong>and the <strong>type<\/strong> should be set to <strong>login<\/strong><\/p>\n<h4>Parameters<\/h4>\n<table class=\"rest-param\">\n<tbody>\n<tr>\n<td>mobileNo<\/td>\n<td>User\u2019s Phone number<\/td>\n<\/tr>\n<tr>\n<td>countrycode<\/td>\n<td>Country code of Phone (with + symbol)<\/td>\n<\/tr>\n<tr>\n<td>otp<\/td>\n<td>One Time Passcode<\/td>\n<\/tr>\n<tr>\n<td>ftoken<\/td>\n<td><a href=\"https:\/\/firebase.google.com\/docs\/auth\/admin\/verify-id-tokens\">Firebase ID Token<\/a> if using Firebase Gateway<\/td>\n<\/tr>\n<tr>\n<td>code<\/td>\n<td>AccountKit authorization code if using Account Kit Gateway<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Response<\/h4>\n<div class=\"res-suc\"><span class=\"res-msg\">Success<\/span><br \/>{&#8220;success&#8221;:true,&#8221;data&#8221;:{&#8220;user_id&#8221;:&#8221;user_id&#8221;,&#8221;access_token&#8221;:&#8221;Access Token&#8221;,&#8221;token_type&#8221;:&#8221;bearer&#8221;}}\n<p class=\"res-notice\">You can use this authentication token to authenticate user (See <a href=\"#authentication\">Authentication section<\/a> for more details)<\/p>\n<\/div>\n<div class=\"res-fail\"><span class=\"res-msg\">Failure<\/span><br \/>{&#8220;success&#8221;:false,&#8221;data&#8221;:{&#8220;code&#8221;:&#8221;-1&#8243;,&#8221;msg&#8221;:&#8221;Error Message&#8221;}}<\/div>\n<div>\u00a0<\/div>\n<div>\u00a0<\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"php-endpoints\">PHP Endpoints<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-user-access-token\">Get User Access Token<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">digits_get_user_access_tokens($user_id);<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Returns arrays of std object of <\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>&nbsp;id<\/strong><\/td><td>&nbsp;Token ID<\/td><\/tr><tr><td><strong>&nbsp;user_id<\/strong><\/td><td>&nbsp;WordPress User ID<\/td><\/tr><tr><td><strong>&nbsp;access_token<\/strong><\/td><td>&nbsp;Access Token<\/td><\/tr><tr><td><strong>&nbsp;ip<\/strong><\/td><td>&nbsp;IP address from which token was created<\/td><\/tr><tr><td><strong>&nbsp;last_time<\/strong><\/td><td>&nbsp;Last time when token was used for authotizing user<\/td><\/tr><tr><td><strong>&nbsp;create_time<\/strong><\/td><td>&nbsp;Time of token creation<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-user-from-access-token\">Get User from Access Token<\/h4>\n\n\n\n<p>You can even use this to verify token.<br>Returns: <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_user\/\" target=\"_blank\">WP_User<\/a> object on success, false on failure. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">digits_get_user_from_access_token($auth_token)<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"delete-user-token\">Delete User Token<\/h4>\n\n\n\n<p> Returns: number of tokens affected on success, false on failure. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">digits_delete_access_token($auth_token)<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"delete-all-user-tokens\">Delete All User Tokens<\/h4>\n\n\n\n<p> Returns: number of tokens affected on success, false on failure. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">digits_delete_user_access_tokens($user_id)<\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"miscellaneous\">Miscellaneous <\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"add-custom-data-in-response\">Add Custom Data in response<\/h4>\n\n\n\n<p>Add the below code to your child theme<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter('digits_rest_token_data', 'digits_rest_add_user_id', 10, 2);\nfunction digits_rest_add_user_id($data, $user_id){\n    $data['your_key'] = get_user_meta($user_id, 'meta_key'); \n    return $data;\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"change-or-modify-token\">Change or Modify Token<\/h4>\n\n\n\n<p>If you want to use any third party bearer token or you want to modify access token you can use the following code<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter('digits_rest_token', 'digits_change_token', 10, 2);\nfunction digits_change_token($access_token, $user_id){\n\n    \/\/ your code to modify token\n\n    return $access_token;\n}<\/pre>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":57,"template":"","format":"standard","manualknowledgebasecat":[8],"manual_kb_tag":[],"class_list":["post-488","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-addons"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>REST API Digits Add-on for WordPress<\/title>\n<meta name=\"description\" content=\"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"REST API Digits Add-on for WordPress\" \/>\n<meta property=\"og:description\" content=\"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Digits Help\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-05T19:31:49+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/\",\"url\":\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/\",\"name\":\"REST API Digits Add-on for WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/help.unitedover.com\/digits\/#website\"},\"datePublished\":\"2019-08-10T11:36:38+00:00\",\"dateModified\":\"2024-08-05T19:31:49+00:00\",\"description\":\"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.\",\"breadcrumb\":{\"@id\":\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/help.unitedover.com\/digits\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"REST API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/help.unitedover.com\/digits\/#website\",\"url\":\"https:\/\/help.unitedover.com\/digits\/\",\"name\":\"Digits Help\",\"description\":\"WordPress Mobile Number Signup and Login\",\"publisher\":{\"@id\":\"https:\/\/help.unitedover.com\/digits\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/help.unitedover.com\/digits\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/help.unitedover.com\/digits\/#organization\",\"name\":\"UnitedOver\",\"url\":\"https:\/\/help.unitedover.com\/digits\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/help.unitedover.com\/digits\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/help.unitedover.com\/digits\/wp-content\/uploads\/sites\/2\/2018\/11\/logo512.png\",\"contentUrl\":\"https:\/\/help.unitedover.com\/digits\/wp-content\/uploads\/sites\/2\/2018\/11\/logo512.png\",\"width\":512,\"height\":512,\"caption\":\"UnitedOver\"},\"image\":{\"@id\":\"https:\/\/help.unitedover.com\/digits\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"REST API Digits Add-on for WordPress","description":"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/","og_locale":"en_US","og_type":"article","og_title":"REST API Digits Add-on for WordPress","og_description":"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.","og_url":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/","og_site_name":"Digits Help","article_modified_time":"2024-08-05T19:31:49+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/","url":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/","name":"REST API Digits Add-on for WordPress","isPartOf":{"@id":"https:\/\/help.unitedover.com\/digits\/#website"},"datePublished":"2019-08-10T11:36:38+00:00","dateModified":"2024-08-05T19:31:49+00:00","description":"Unlock the full potential of Digits with our REST API add-on, enabling seamless integration and extended functionality. Integrate Digits with other applications, platforms, or custom solutions using the power of REST API. Simplify user authentication, registration, and verification processes by leveraging the flexibility and versatility of REST API integration. Explore the possibilities and streamline your user management workflows with the REST API add-on for Digits.","breadcrumb":{"@id":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/help.unitedover.com\/digits\/kb\/rest-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/help.unitedover.com\/digits\/"},{"@type":"ListItem","position":2,"name":"REST API"}]},{"@type":"WebSite","@id":"https:\/\/help.unitedover.com\/digits\/#website","url":"https:\/\/help.unitedover.com\/digits\/","name":"Digits Help","description":"WordPress Mobile Number Signup and Login","publisher":{"@id":"https:\/\/help.unitedover.com\/digits\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/help.unitedover.com\/digits\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/help.unitedover.com\/digits\/#organization","name":"UnitedOver","url":"https:\/\/help.unitedover.com\/digits\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/help.unitedover.com\/digits\/#\/schema\/logo\/image\/","url":"https:\/\/help.unitedover.com\/digits\/wp-content\/uploads\/sites\/2\/2018\/11\/logo512.png","contentUrl":"https:\/\/help.unitedover.com\/digits\/wp-content\/uploads\/sites\/2\/2018\/11\/logo512.png","width":512,"height":512,"caption":"UnitedOver"},"image":{"@id":"https:\/\/help.unitedover.com\/digits\/#\/schema\/logo\/image\/"}}]}},"acf":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manual_kb\/488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":9,"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manual_kb\/488\/revisions"}],"predecessor-version":[{"id":2281,"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manual_kb\/488\/revisions\/2281"}],"wp:attachment":[{"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manualknowledgebasecat?post=488"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/help.unitedover.com\/digits\/wp-json\/wp\/v2\/manual_kb_tag?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}