groovy:LinkedHash: missing property - groovy

I'm struggling to remove key 'customerNumber' from sub-arrays allAddresses and allPersons. my requirement is that in the below payload key customerNumber should only appear in the parent array CustomerMaster. all other appearances of customerNumber should be deleted.
with the below code I get error groovy.lang.MissingPropertyException: No such property: allAddresses for class: java.util.LinkedHashMap$Entry. To my surprise the code works when the key CustomerMaster is an array. I dont understand why it fails if the customer is not an array
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import groovy.json.JsonSlurper;
import groovy.json.JsonOutput;
import groovy.json.*
def Message removeCustomerNumber(Message message) {
def body = message.getBody(String)
//def body = message.getBody(String.class);
body=body.toString();
def json = new JsonSlurper().parseText(body)
json.CustomerMaster.each{
// if (it.allAddresses.metaClass.respondsTo('each')){
// if(it.metaClass.hasProperty(it, 'allAddresses')){
it.allAddresses.each{
it.remove('customerNumber')
}
// }
// }
}
def out= JsonOutput.toJson(json);
//out = JsonOutput.prettyPrint()
message.setBody(out);
return message;
}
in other words when the CustomerMaster is an collection, I have no issue. I tried checking with hasProperty() and respondsTo() with out success
payload:
{
"CustomerMaster": {
"activitySector": "01",
"cognosCode": "ES001",
"companyName1": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"companyName2": "ALIAXIS IBERIA S.A.U.",
"creditControlArea": "ES01",
"currency": "EUR",
"customerNumber": "0000100001",
"allPersons": [
{
"birthday": "00000000",
"cognosCode": "ES001",
"contactId": "0000000308",
"customerNumber": "0000100001",
"jobTitle": "ENCARGADO COBROS",
"language": "ES",
"lastName": "EDUARDO JIMENEZ"
},
{
"birthday": "20210419",
"cognosCode": "ES001",
"contactId": "0000000475",
"customerNumber": "0000100001",
"email1": "FACTURASPDF.SNPT#ABAST.ES",
"jobTitle": "ENVÍO FACTURACIÓN",
"language": "ES",
"lastName": "FACTURACION"
},
{
"birthday": "00000000",
"cognosCode": "ES001",
"contactId": "0000000036",
"customerNumber": "0000100001",
"jobTitle": "REPRESENTANTE LEGAL",
"language": "ES",
"lastName": "D. JULIO ESTEBAN SALGADO"
}
],
"allAddresses": [
{
"StateOrProvince": "MERES-SIERO",
"city": "MERES-SIERO",
"countryCode": "ES",
"customerNumber": "0000100001",
"fax": "985793802",
"id": "0000372156",
"name": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"number": "1",
"phoneBusiness": "985-792224",
"postalCode": "33199",
"region": "33",
"street": "POL.IND.PRONI. CALLE D",
"type": "WE"
},
{
"StateOrProvince": "MERES-SIERO",
"city": "MERES-SIERO",
"countryCode": "ES",
"customerNumber": "0000100001",
"fax": "985793802",
"id": "0000372156",
"name": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"number": "1",
"phoneBusiness": "985-792224",
"postalCode": "33199",
"region": "33",
"street": "POL.IND.PRONI. CALLE D",
"type": "AG"
},
{
"StateOrProvince": "MERES-SIERO",
"city": "MERES-SIERO",
"countryCode": "ES",
"customerNumber": "0000100001",
"fax": "985793802",
"id": "0000372156",
"name": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"number": "1",
"phoneBusiness": "985-792224",
"postalCode": "33199",
"region": "33",
"street": "POL.IND.PRONI. CALLE D",
"type": "RE"
},
{
"StateOrProvince": "MERES-SIERO",
"city": "MERES-SIERO",
"countryCode": "ES",
"customerNumber": "0000100001",
"fax": "985793802",
"id": "0000372156",
"name": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"number": "1",
"phoneBusiness": "985-792224",
"postalCode": "33199",
"region": "33",
"street": "POL.IND.PRONI. CALLE D",
"type": "RG"
},
{
"StateOrProvince": "MERES-SIERO",
"city": "MERES-SIERO",
"countryCode": "ES",
"customerNumber": "0000100001",
"fax": "985793802",
"id": "0000372156",
"name": "SANIPLAST SOL. SOSTEN. DEL AGUA SL",
"number": "1",
"phoneBusiness": "985-792224",
"postalCode": "33199",
"region": "33",
"street": "POL.IND.PRONI. CALLE D",
"type": "ZV"
}
],
"email1": "JUANJOSE.GONZALEZ#SANIPLAST.ES",
"entityCode": "ES01",
"fax": "985793802",
"phone1": "985-792224",
"phone2": "985791154ISABEL",
"termsofPayment": "Z037"
}
}

def json = new JsonSlurper().parseText(body)
if(json.CustomerMaster instanceof List){
json.CustomerMaster.each{
it.allPersons?.each{it.remove("customerNumber")}
it.allAddresses?.each{it.remove("customerNumber")}
}
}else{
json.CustomerMaster?.allPersons?.each{it.remove("customerNumber")}
json.CustomerMaster?.allAddresses?.each{it.remove("customerNumber")}
}
with ternary operator
( json.CustomerMaster instanceof List ? json.CustomerMaster : [json.CustomerMaster] ).each{
it?.allPersons?.each{it.remove("customerNumber")}
it?.allAddresses?.each{it.remove("customerNumber")}
}

Related

Multi-Level grouping aggregate with MongoDB

I have project we are working for, and I have chart of account built with multi-level parent/children
ex.
[
{
"_id": "6339dc11de91f060af6e17e0",
"name": "Cash",
"code": "1",
"codeChain": "1",
"isParent": true
},
{
"_id": "6339dc11de91f060af6e17e1",
"parent": "6339dc11de91f060af6e17e0",
"name": "Cash",
"code": "01",
"codeChain": "1.01",
"isParent": true
},
{
"_id": "6339dc11de91f060af6e17e2",
"parent": "6339dc11de91f060af6e17e1",
"name": "Cash",
"code": "001",
"codeChain": "1.01.001",
"isParent": true
},
{
"_id": "6339dc11de91f060af6e17e3",
"parent": "6339dc11de91f060af6e17e2",
"name": "Cash",
"code": "001",
"codeChain": "1.01.001.001",
"isParent": true
}
// and so on
]
then we need to make a query to get the result of :
[
{
"_id": "6339dc11de91f060af6e17e0",
"name": "Cash",
"code": "1",
"codeChain": "1",
"isParent": true,
"children": [
{
{
"_id": "6339dc11de91f060af6e17e1",
"parent": "6339dc11de91f060af6e17e0",
"name": "Cash",
"code": "01",
"codeChain": "1.01",
"isParent": true,
"children": [
{
"_id": "6339dc11de91f060af6e17e2",
"parent": "6339dc11de91f060af6e17e1",
"name": "Cash",
"code": "001",
"codeChain": "1.01.001",
"isParent": true,
"children": [
{
"_id": "6339dc11de91f060af6e17e3",
"parent": "6339dc11de91f060af6e17e2",
"name": "Cash",
"code": "001",
"codeChain": "1.01.001.001",
"isParent": true
}
]
}
]
}
}
]
}
// and so on
]
NOTED THAT : We don't know how deep it could be, and also we have other collections with the transactions we will link it later
Or should we change all the data structure to serve that need !

Loadrunner json parser

Requirement- from below code snippet, i need to pull data related to market segment= unicare.
in the subsequent request need to pass both state and market segment unicare..
first i need to find do i see unicare market segement.. if Yes what is the first occurance and its associated state. to be captured and placed in the consequent request.
tried lr_json_get_values. can you please help on this.
{
"taxID": "23424",
"firstName": "afsafa",
"lastName": "asdfsfa",
"middleName": "adfasad",
"npn": "324322424",
"stateResident": "WI",
"dateBirth": "234324224",
"licenseDetails": [
{
"state": "CO",
"license": [
{
"licenseNum": "3234224",
"dateUpdated": "12/08/2020",
"dateIssueLicenseOrg": "324242",
"dateExpireLicense": "243242",
"licenseClass": "avadfa Producer",
"licenseClassCode": "2",
"residencyStatus": "444",
"active": "Yes",
"details": [
{
"loa": "aafafafa",
"loaCode": "44444",
"authorityIssueDate": "44345353",
"status": "Active",
"statusReasonDate": "444444",
"ceCompliance": "N/S",
"ceCreditsNeeded": "0"
}
]
}
],
"address": [
{
"dateUpdated": "423333",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "asssss",
"nameCity": "aaaa",
"nameState": "WI",
"zip": "4444444",
"country": "U.S.A."
},
{
"dateUpdated": "10/22/2020",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "Fhk sfsfsafs",
"addrLine2": "6sdfsfsfa Ave",
"nameCity": "dfsafa",
"nameState": "WI",
"zip": "sdfsaff",
"country": "U.S.A."
},
{
"dateUpdated": "45353",
"addressTypeCode": "1",
"addrType": "45adfa",
"addrLine1": "1sfsafaf",
"nameCity": "adfafafa",
"nameState": "WI",
"zip": "34444-434",
"country": "U.S.A."
}
],
"brands": [
"ALWAYS"
],
"marketSegment": [
{
"brandName": "ALWAYS",
"lobTypes": [
"Individual",
"Senior"
]
},
{
"brandName": "Unicare",
"lobTypes": [
"Individual",
"Senior",
"Small Group",
"Large Group"
]
}
],
"isLifeExists": false
},
{
"state": "FL",
"license": [
{
"licenseNum": "3234224",
"dateUpdated": "12/08/2020",
"dateIssueLicenseOrg": "324242",
"dateExpireLicense": "243242",
"licenseClass": "avadfa Producer",
"licenseClassCode": "2",
"residencyStatus": "444",
"active": "Yes",
"details": [
{
"loa": "aafafafa",
"loaCode": "44444",
"authorityIssueDate": "44345353",
"status": "Active",
"statusReasonDate": "444444",
"ceCompliance": "N/S",
"ceCreditsNeeded": "0"
}
]
}
],
"address": [
{
"dateUpdated": "423333",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "asssss",
"nameCity": "aaaa",
"nameState": "WI",
"zip": "4444444",
"country": "U.S.A."
},
{
"dateUpdated": "10/22/2020",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "Fhk sfsfsafs",
"addrLine2": "6sdfsfsfa Ave",
"nameCity": "dfsafa",
"nameState": "WI",
"zip": "sdfsaff",
"country": "U.S.A."
},
{
"dateUpdated": "45353",
"addressTypeCode": "1",
"addrType": "45adfa",
"addrLine1": "1sfsafaf",
"nameCity": "adfafafa",
"nameState": "WI",
"zip": "34444-434",
"country": "U.S.A."
}
],
"brands": [],
"marketSegment": [
{
"brandName": "Unicare",
"lobTypes": [
"Individual",
"Senior",
"Small Group",
"Large Group"
]
}
],
"isLifeExists": false
},
{
"state": "WI",
"license": [
{
"licenseNum": "3234224",
"dateUpdated": "12/08/2020",
"dateIssueLicenseOrg": "324242",
"dateExpireLicense": "243242",
"licenseClass": "avadfa Producer",
"licenseClassCode": "2",
"residencyStatus": "444",
"active": "Yes",
"details": [
{
"loa": "aafafafa",
"loaCode": "44444",
"authorityIssueDate": "44345353",
"status": "Active",
"statusReasonDate": "444444",
"ceCompliance": "N/S",
"ceCreditsNeeded": "0"
}
]
}
],
"address": [
{
"dateUpdated": "423333",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "asssss",
"nameCity": "aaaa",
"nameState": "WI",
"zip": "4444444",
"country": "U.S.A."
},
{
"dateUpdated": "10/22/2020",
"addressTypeCode": "2",
"addrType": "adfafa",
"addrLine1": "Fhk sfsfsafs",
"addrLine2": "6sdfsfsfa Ave",
"nameCity": "dfsafa",
"nameState": "WI",
"zip": "sdfsaff",
"country": "U.S.A."
},
{
"dateUpdated": "45353",
"addressTypeCode": "1",
"addrType": "45adfa",
"addrLine1": "1sfsafaf",
"nameCity": "adfafafa",
"nameState": "WI",
"zip": "34444-434",
"country": "U.S.A."
}
],
"brands": [
"ALWAYS",
"WCICWCICsd(sdfsafasdfsa COLLABORATIVE sdfsfsdf COMP)"
],
"marketSegment": [
{
"brandName": "ALWAYS",
"lobTypes": [
"Individual",
"Senior",
"Small Group",
"Large Group"
]
},
{
"brandName": "WCICsd(sdfsafasdfsa COLLABORATIVE sdfsfsdf COMP)",
"lobTypes": [
"Individual",
"Small Group",
"Large Group"
]
},
{
"brandName": "Unicare",
"lobTypes": [
"Individual",
"Senior",
"Small Group",
"Large Group"
]
}
],
"isLifeExists": true
}
]
}

Mongodb filter results with unique value

I have a collections of bunch of cities and zip codes, where name of a city can be a same, while zip code is different.
I'm trying to query thru all cities starting with 'San' for example and want to filter results where San Antonio appears only ones along with any other cities starting with San.
Here is a code I use:
Zipcodes.find(
{ city: { $regex: /San/, $options: 'i' } },
(err, result) => {
if (err) {
return res.send({ error: err });
}
res.send({ data: result });
},
).limit(20);
This given me following results:
{
"loc": [
-94.132581,
31.515173
],
"_id": "75972",
"city": "SAN AUGUSTINE",
"pop": 5916,
"state": "TX"
},
{
"loc": [
-98.730929,
31.162678
],
"_id": "76877",
"city": "SAN SABA",
"pop": 4023,
"state": "TX"
},
{
"loc": [
-100.481752,
31.478165
],
"_id": "76901",
"city": "SAN ANGELO",
"pop": 23800,
"state": "TX"
},
{
"loc": [
-100.480036,
31.419411
],
"_id": "76904",
"city": "SAN ANGELO",
"pop": 25535,
"state": "TX"
},
{
"loc": [
-100.390005,
31.464738
],
"_id": "76905",
"city": "SAN ANGELO",
"pop": 11284,
"state": "TX"
},
{
"loc": [
-100.438586,
31.470735
],
"_id": "76903",
"city": "SAN ANGELO",
"pop": 32471,
"state": "TX"
},
{
"loc": [
-95.034496,
29.466033
],
"_id": "77539",
"city": "SAN LEON",
"pop": 21905,
"state": "TX"
},
{
"loc": [
-99.427148,
27.062523
],
"_id": "78067",
"city": "SAN YGNACIO",
"pop": 871,
"state": "TX"
},
{
"loc": [
-98.460127,
29.414799
],
"_id": "78203",
"city": "SAN ANTONIO",
"pop": 7261,
"state": "TX"
},
{
"loc": [
-98.525967,
29.422855
],
"_id": "78207",
"city": "SAN ANTONIO",
"pop": 58355,
"state": "TX"
},
{
"loc": [
-98.5063,
29.400217
],
"_id": "78204",
"city": "SAN ANTONIO",
"pop": 11526,
"state": "TX"
},
{
"loc": [
-98.479338,
29.441338
],
"_id": "78215",
"city": "SAN ANTONIO",
"pop": 1264,
"state": "TX"
},
{
"loc": [
-98.545219,
29.358366
],
"_id": "78211",
"city": "SAN ANTONIO",
"pop": 30417,
"state": "TX"
},
{
"loc": [
-98.492509,
29.423711
],
"_id": "78205",
"city": "SAN ANTONIO",
"pop": 1714,
"state": "TX"
},
{
"loc": [
-98.497511,
29.533387
],
"_id": "78216",
"city": "SAN ANTONIO",
"pop": 30435,
"state": "TX"
},
{
"loc": [
-98.419444,
29.539525
],
"_id": "78217",
"city": "SAN ANTONIO",
"pop": 27925,
"state": "TX"
}
It's returning San Antonio many times. I need only ones.
Please help with a correct query. Thanks.
You can use $group + $replaceRoot to get values unique by city:
db.collection.aggregate([
{
$match: { city: { $regex: "San", $options: "i" } }
},
{
$group: {
_id: "$city",
doc: { $first: "$$ROOT" }
}
},
{
$replaceRoot: {
newRoot: "$doc"
}
}
])
Mongo Playground

How to setup Partial Authentication using Authorize API

Okay I am setting up Partial Payments via the Authorize.net API in order to enable multiple cards to be used to cover a single balance/charge.
I'm assuming thier Partial Auth feature covers my use case, but in testing, there is an issue I can show you using the API live console here: https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card
Go to the link above and authorize partial payments with the request I edited below and you will notice when you press submit you get a splitTenderId:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "346HZ32z3fP4hTG2"
},
"refId": "123456",
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "462.25",
"payment": {
"creditCard": {
"cardNumber": "5424000000000015",
"expirationDate": "2020-12",
"cardCode": "999"
}
},
"lineItems": {
"lineItem": {
"itemId": "1",
"name": "vase",
"description": "Cannes logo",
"quantity": "18",
"unitPrice": "45.00"
}
},
"tax": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"duty": {
"amount": "8.55",
"name": "duty name",
"description": "duty description"
},
"shipping": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"poNumber": "456654",
"customer": {
"id": "99999456654"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"shipTo": {
"firstName": "China",
"lastName": "Bayles",
"company": "Thyme for Tea",
"address": "12 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"customerIP": "192.168.1.1",
"transactionSettings": {
"setting": [
{
"settingName": "emailCustomer",
"settingValue": "true"
}, {
"settingName": "allowPartialAuth",
"settingValue": "true"
},
]
},
"userFields": {
"userField": [
{
"name": "MerchantDefinedFieldName1",
"value": "MerchantDefinedFieldValue1"
},
{
"name": "favorite_color",
"value": "blue"
}
]
}
}
}
}
This is only successful because the amount is 462.25 as the docs say to use for testing, if I use any other (real) amount the splitTenderId is not there.
Here is a new example request, you can post this again on the link above:
{
"createTransactionRequest": {
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "346HZ32z3fP4hTG2"
},
"refId": "123456",
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": "462",
"payment": {
"creditCard": {
"cardNumber": "5424000000000015",
"expirationDate": "2020-12",
"cardCode": "999"
}
},
"lineItems": {
"lineItem": {
"itemId": "1",
"name": "vase",
"description": "Cannes logo",
"quantity": "18",
"unitPrice": "45.00"
}
},
"tax": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"duty": {
"amount": "8.55",
"name": "duty name",
"description": "duty description"
},
"shipping": {
"amount": "4.26",
"name": "level2 tax name",
"description": "level2 tax"
},
"poNumber": "456654",
"customer": {
"id": "99999456654"
},
"billTo": {
"firstName": "Ellen",
"lastName": "Johnson",
"company": "Souveniropolis",
"address": "14 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"shipTo": {
"firstName": "China",
"lastName": "Bayles",
"company": "Thyme for Tea",
"address": "12 Main Street",
"city": "Pecan Springs",
"state": "TX",
"zip": "44628",
"country": "USA"
},
"customerIP": "192.168.1.1",
"transactionSettings": {
"setting": [
{
"settingName": "emailCustomer",
"settingValue": "true"
}, {
"settingName": "allowPartialAuth",
"settingValue": "true"
},
]
},
"userFields": {
"userField": [
{
"name": "MerchantDefinedFieldName1",
"value": "MerchantDefinedFieldValue1"
},
{
"name": "favorite_color",
"value": "blue"
}
]
}
}
}
}
And with the 462 amount entered this is no longer a partial auth payment and I no longer get a splitTenderId.
Can someone please help me figure out what is going on?

create contact from node.js to mautic uisng Mautic rest api

I am using mautic-node npm module for contacting mautic REST API from node.js.My aim is to create a contact from my app in mautic dashboard using mautic REST API,but i am facing issue in creating contact from node.js.Please help me to figure out this.
var mautic = require('mautic-api-node');
var request = require('request');
var config = require('../config/config.js');
var request = require('request');
exports.saveContact = (req, res) => {
queryParameters = JSON.stringify(req.body);
var username = "mauticUsername";
var password = "mauticPassword";
var auth = "Basic " + new Buffer.from(username + ":" +
password).toString("base64");
var options = {
url: 'https://mautic-url/api/contacts/new',
method: "POST",
form: queryParameters,
headers: {
"Authorization": auth
}
};
request(options, (error, response, body) => {
if (error) console.log(error);
console.log("Body", body);
})
}
I am passing this request body to backend:-
{
"firstname":"firstname",
"ipAddress":"Ipaddress",
"lastname":"lastname",
"email":"email"
}
when i run this code i am getting this response
Body {
"contact": {
"isPublished": true,
"dateAdded": "2019-06-08T10:06:25+00:00",
"dateModified": null,
"createdBy": 1,
"createdByUser": "username",
"modifiedBy": null,
"modifiedByUser": null,
"id": 1277,
"points": 0,
"color": null,
"fields": {
"core": {
"title": {
"id": 1,
"group": "core",
"label": "Title",
"alias": "title",
"type": "lookup",
"value": null
},
"firstname": {
"id": 2,
"group": "core",
"label": "First Name",
"alias": "firstname",
"type": "text",
"value": null
},
"lastname": {
"id": 3,
"group": "core",
"label": "Last Name",
"alias": "lastname",
"type": "text",
"value": null
},
"company": {
"id": 4,
"group": "core",
"label": "Primary company",
"alias": "company",
"type": "text",
"value": null
},
"position": {
"id": 5,
"group": "core",
"label": "Position",
"alias": "position",
"type": "text",
"value": null
},
"email": {
"id": 6,
"group": "core",
"label": "Email",
"alias": "email",
"type": "email",
"value": null
},
"mobile": {
"id": 7,
"group": "core",
"label": "Mobile",
"alias": "mobile",
"type": "tel",
"value": null
},
"phone": {
"id": 8,
"group": "core",
"label": "Phone",
"alias": "phone",
"type": "tel",
"value": null
},
"points": {
"id": 9,
"group": "core",
"label": "Points",
"alias": "points",
"type": "number",
"value": null
},
"fax": {
"id": 10,
"group": "core",
"label": "Fax",
"alias": "fax",
"type": "tel",
"value": null
},
"address1": {
"id": 11,
"group": "core",
"label": "Address Line 1",
"alias": "address1",
"type": "text",
"value": null
},
"address2": {
"id": 12,
"group": "core",
"label": "Address Line 2",
"alias": "address2",
"type": "text",
"value": null
},
"city": {
"id": 13,
"group": "core",
"label": "City",
"alias": "city",
"type": "text",
"value": null
},
"state": {
"id": 14,
"group": "core",
"label": "State",
"alias": "state",
"type": "region",
"value": null
},
"zipcode": {
"id": 15,
"group": "core",
"label": "Zip Code",
"alias": "zipcode",
"type": "text",
"value": null
},
"country": {
"id": 16,
"group": "core",
"label": "Country",
"alias": "country",
"type": "country",
"value": null
},
"preferred_locale": {
"id": 17,
"group": "core",
"label": "Preferred Locale",
"alias": "preferred_locale",
"type": "locale",
"value": null
},
"timezone": {
"id": 18,
"group": "core",
"label": "mautic.lead.field.timezone",
"alias": "timezone",
"type": "timezone",
"value": null
},
"last_active": {
"id": 19,
"group": "core",
"label": "Date Last Active",
"alias": "last_active",
"type": "datetime",
"value": null
},
"attribution_date": {
"id": 20,
"group": "core",
"label": "Attribution Date",
"alias": "attribution_date",
"type": "datetime",
"value": null
},
"attribution": {
"id": 21,
"group": "core",
"label": "Attribution",
"alias": "attribution",
"type": "number",
"value": null
},
"website": {
"id": 22,
"group": "core",
"label": "Website",
"alias": "website",
"type": "url",
"value": null
}
},
"social": {
"facebook": {
"id": 23,
"group": "social",
"label": "Facebook",
"alias": "facebook",
"type": "text",
"value": null
},
"foursquare": {
"id": 24,
"group": "social",
"label": "Foursquare",
"alias": "foursquare",
"type": "text",
"value": null
},
"googleplus": {
"id": 25,
"group": "social",
"label": "Google+",
"alias": "googleplus",
"type": "text",
"value": null
},
"instagram": {
"id": 26,
"group": "social",
"label": "Instagram",
"alias": "instagram",
"type": "text",
"value": null
},
"linkedin": {
"id": 27,
"group": "social",
"label": "LinkedIn",
"alias": "linkedin",
"type": "text",
"value": null
},
"skype": {
"id": 28,
"group": "social",
"label": "Skype",
"alias": "skype",
"type": "text",
"value": null
},
"twitter": {
"id": 29,
"group": "social",
"label": "Twitter",
"alias": "twitter",
"type": "text",
"value": null
}
},
"personal": [],
"professional": [],
"all": {
"id": 1277,
"title": null,
"firstname": null,
"lastname": null,
"company": null,
"position": null,
"email": null,
"mobile": null,
"phone": null,
"points": null,
"fax": null,
"address1": null,
"address2": null,
"city": null,
"state": null,
"zipcode": null,
"country": null,
"preferred_locale": null,
"timezone": null,
"last_active": null,
"attribution_date": null,
"attribution": null,
"website": null,
"facebook": null,
"foursquare": null,
"googleplus": null,
"instagram": null,
"linkedin": null,
"skype": null,
"twitter": null
}
},
"lastActive": null,
"owner": null,
"ipAddresses": [],
"tags": [],
"utmtags": null,
"stage": null,
"dateIdentified": null,
"preferredProfileImage": null,
"doNotContact": [],
"frequencyRules": []
}
}
This is the response of GET contacts API i guess so i am confused why i am getting GET API response while doing POST request to contact API please help me to figure out this issue.
As you can see in the picture, when you create a new contact along with response status code it returns the properties as well which are similar to "Get Contact" request(as you will get when you get contact by id). So I think as long as your new contact is being created in mautic you shouldn't be worried.

Resources