{"id":4566,"date":"2024-06-20T06:50:46","date_gmt":"2024-06-20T06:50:46","guid":{"rendered":"https:\/\/www.growby.net\/blog\/?p=4566"},"modified":"2024-06-20T06:50:46","modified_gmt":"2024-06-20T06:50:46","slug":"save-user-contacts-api-documentation","status":"publish","type":"post","link":"https:\/\/www.growby.net\/blog\/save-user-contacts-api-documentation\/","title":{"rendered":"Save User Contacts API Documentation"},"content":{"rendered":"<h3>Overview<\/h3>\n<p>The Save User Contacts API allows developers to save multiple user contact details in the system. This API accepts a variety of user-related data, including personal information and group categorization. This endpoint is designed for systems that require bulk or single-entry contact management capabilities.<\/p>\n<h3>Endpoint<\/h3>\n<p><code>POST https:\/\/webapi.whatso.net\/api\/UnAuthorized\/save-user-contacts<\/code><\/p>\n<h3>Request Headers<\/h3>\n<table>\n<thead>\n<tr>\n<th>Header<\/th>\n<th>Value<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Content-Type<\/td>\n<td>application\/json<\/td>\n<td>Indicates the media type of the resource.<\/td>\n<\/tr>\n<tr>\n<td>Accept<\/td>\n<td>application\/json<\/td>\n<td>Media type(s) that is\/are acceptable for the response.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Request Body Parameters<\/h3>\n<p>The request body must be a JSON object containing the following fields:<\/p>\n<table>\n<thead>\n<tr>\n<th>Field<\/th>\n<th>Type<\/th>\n<th>Required<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>userName<\/td>\n<td>String<\/td>\n<td>Yes<\/td>\n<td>Username of the account.<\/td>\n<\/tr>\n<tr>\n<td>password<\/td>\n<td>String<\/td>\n<td>Yes<\/td>\n<td>Password for the account.<\/td>\n<\/tr>\n<tr>\n<td>firstName<\/td>\n<td>String<\/td>\n<td>Yes<\/td>\n<td>User&#8217;s first name.<\/td>\n<\/tr>\n<tr>\n<td>middleName<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s middle name.<\/td>\n<\/tr>\n<tr>\n<td>lastName<\/td>\n<td>String<\/td>\n<td>Yes<\/td>\n<td>User&#8217;s last name.<\/td>\n<\/tr>\n<tr>\n<td>mobileNumber<\/td>\n<td>String<\/td>\n<td>Yes<\/td>\n<td>User&#8217;s mobile phone number.<\/td>\n<\/tr>\n<tr>\n<td>emailId<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s email address.<\/td>\n<\/tr>\n<tr>\n<td>birthDate<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s birth date in YYYY-MM-DD format.<\/td>\n<\/tr>\n<tr>\n<td>weddingDate<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s wedding date in YYYY-MM-DD format.<\/td>\n<\/tr>\n<tr>\n<td>anniversaryDate<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s anniversary date in YYYY-MM-DD format.<\/td>\n<\/tr>\n<tr>\n<td>address<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>User&#8217;s physical address.<\/td>\n<\/tr>\n<tr>\n<td>city<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>City of the user&#8217;s address.<\/td>\n<\/tr>\n<tr>\n<td>state<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>State of the user&#8217;s address.<\/td>\n<\/tr>\n<tr>\n<td>country<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Country of the user&#8217;s address.<\/td>\n<\/tr>\n<tr>\n<td>zipCode<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Postal code of the user&#8217;s address.<\/td>\n<\/tr>\n<tr>\n<td>column1 to column5<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Custom fields for additional information.<\/td>\n<\/tr>\n<tr>\n<td>groupName<\/td>\n<td>String<\/td>\n<td>No<\/td>\n<td>Group name to categorize the contact.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Response<\/h3>\n<p>The API response will be a JSON object containing the results of the operation. The structure of the response JSON will be determined by the parsing and processing done in the callback function.<\/p>\n<p>Example Request<\/p>\n<p>const requestOptions = {<br \/>\nurl: &#8216;https:\/\/webapi.whatso.net\/api\/UnAuthorized\/save-user-contacts&#8217;,<br \/>\nmethod: &#8216;POST&#8217;,<br \/>\nheaders: {<br \/>\n&#8216;Content-Type&#8217;: &#8216;application\/json&#8217;,<br \/>\n&#8216;Accept&#8217;: &#8216;application\/json&#8217;<br \/>\n},<br \/>\nbody: JSON.stringify({<br \/>\nuserName: &#8216;exampleUser&#8217;,<br \/>\npassword: &#8216;examplePass&#8217;,<br \/>\nfirstName: &#8216;John&#8217;,<br \/>\nlastName: &#8216;Doe&#8217;,<br \/>\nmobileNumber: &#8216;1234567890&#8217;,<br \/>\nemailId: &#8216;john.doe@example.com&#8217;,<br \/>\nbirthDate: &#8216;1990-01-01&#8217;,<br \/>\naddress: &#8216;1234 Main St&#8217;,<br \/>\ncity: &#8216;Anytown&#8217;,<br \/>\nstate: &#8216;Anystate&#8217;,<br \/>\ncountry: &#8216;USA&#8217;,<br \/>\nzipCode: &#8216;12345&#8217;<br \/>\n})<br \/>\n};<\/p>\n<p>fetch(requestOptions.url, requestOptions)<br \/>\n.then(response =&gt; response.json())<br \/>\n.then(data =&gt; console.log(data));<\/p>\n<h3>Error Handling<\/h3>\n<p>The API should properly handle and return meaningful error messages in case of failure. Common HTTP status codes like 400 (Bad Request), 401 (Unauthorized), and 500 (Internal Server Error) should be appropriately used to convey the nature of the error.<\/p>\n<h3>Security Considerations<\/h3>\n<p>Since this API involves sensitive user information and authentication details, it is imperative to ensure that all data transmissions are secured using HTTPS. Additionally, proper validation and sanitization of all input fields should be implemented to prevent injection attacks and other security vulnerabilities.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview The Save User Contacts API allows developers to save &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Save User Contacts API Documentation\" class=\"read-more button\" href=\"https:\/\/www.growby.net\/blog\/save-user-contacts-api-documentation\/#more-4566\" aria-label=\"More on Save User Contacts API Documentation\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4566","post","type-post","status-publish","format-standard","hentry","category-uncategorized","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"_links":{"self":[{"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/posts\/4566"}],"collection":[{"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/comments?post=4566"}],"version-history":[{"count":1,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/posts\/4566\/revisions"}],"predecessor-version":[{"id":4567,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/posts\/4566\/revisions\/4567"}],"wp:attachment":[{"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/media?parent=4566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/categories?post=4566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.growby.net\/blog\/wp-json\/wp\/v2\/tags?post=4566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}