Each contact comes twice

Hi,

I called contact api “contacts?view=suppliers”, each contacts comes twice. company has only 4 contacts.

May I know what could be the reason, herewith I am giving returned json object.

{{
“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]
}}
ChildrenTokens: Count = 1
Count: 1
First: {“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]}
HasValues: true
Last: {“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]}
Next: null
Parent: null
Path: “”
Previous: null
Root: {{
“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]
}}

These looks like two separate responses? In your post the response ends with

}
]
}}

Then it looks like some debug stuff printed (this does not come from our API response)

ChildrenTokens: Count = 1
Count: 1

Then it looks like you’re outputting the response again via some code with:

First: {“contacts”: [
{

Am I reading the output correctly?

Cheers

Phil

Hi Phil,

Yes, you are reading correct. Have a look again.

{{
“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]
}}
ChildrenTokens: Count = 1
Count: 1
First: {“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]}
HasValues: true
Last: {“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]}
Next: null
Parent: null
Path: “”
Previous: null
Root: {{
“contacts”: [
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86326”,
“organisation_name”: “CAAX ltd”,
“first_name”: “Heet”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-02T17:27:40Z”,
“updated_at”: “2020-09-05T07:51:58Z”,
“email”: “heet.caax@gmail.com”,
“billing_email”: “heet.caax@gmail.com”,
“phone_number”: “7043487569”,
“address1”: “202, Chintaman elegance,”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“address2”: “nav”,
“address3”: “, ahme”,
“contact_name_on_invoices”: true,
“country”: “India”,
“sales_tax_registration_number”: “12345”,
“charge_sales_tax”: “Auto”,
“locale”: “en”,
“mobile”: “7043487569”,
“account_balance”: “-2200.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: true,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: true,
“default_payment_terms_in_days”: 30
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86329”,
“organisation_name”: “New Supplier From Process Page”,
“first_name”: “New”,
“last_name”: “Supplier”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T05:25:45Z”,
“updated_at”: “2020-09-03T05:25:45Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “0.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 20
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86328”,
“organisation_name”: “Tcs Consultancy”,
“first_name”: “Suryakant”,
“last_name”: “Patel”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:18:44Z”,
“updated_at”: “2020-09-04T13:58:44Z”,
“email”: “s@s.com”,
“phone_number”: “50031615”,
“address1”: “Address One One”,
“town”: “Ahmedabad”,
“region”: “Gujarat”,
“postcode”: “380009”,
“contact_name_on_invoices”: false,
“country”: “India”,
“sales_tax_registration_number”: “vat101”,
“locale”: “en”,
“mobile”: “9824527887”,
“account_balance”: “-600.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 25
},
{
“url”: “https://api.sandbox.freeagent.com/v2/contacts/86327”,
“organisation_name”: “Ts”,
“active_projects_count”: 0,
“created_at”: “2020-09-03T04:17:15Z”,
“updated_at”: “2020-09-04T13:57:50Z”,
“contact_name_on_invoices”: false,
“country”: “United Kingdom”,
“locale”: “en”,
“account_balance”: “-400.0”,
“status”: “Active”,
“uses_contact_invoice_sequence”: false,
“emails_invoices_automatically”: false,
“emails_payment_reminders”: false,
“emails_thank_you_notes”: false,
“uses_contact_level_email_settings”: false,
“default_payment_terms_in_days”: 30
}
]
}}

Can you please post only the API call you’re making, with arguments (without any tokens/client_id/client_secrets) and the response you’ve gotten from API without intermixed debug output?

Cheers

Phil

Hi Phil,

Please check below, is this correct as you are asking?

{StatusCode: 200, ReasonPhrase: ‘OK’, Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Connection: keep-alive
Pragma: no-cache
Link:
X-Total-Count: 4
X-Request-Id: c473b1ec0e7f96ccf82abf58cd04e15f
X-Rev: 3bdc4117e35f1cfe9af5d8fe5943fbfca873aa4b
X-Host: ip-10-133-87-231
X-Runtime: 0.122467
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Vary: Origin
Strict-Transport-Security: max-age=31536000
Cache-Control: no-store, private
Date: Fri, 18 Sep 2020 14:42:20 GMT
ETag: W/“058d61c372b01945b1fcd80d7c5aed8f”
Server: nginx/1.19.2
Content-Length: 2792
Content-Type: application/json; charset=utf-8
}}
Content: {System.Net.Http.StreamContent}
Headers: {Connection: keep-alive
Pragma: no-cache
Link:
X-Total-Count: 4
X-Request-Id: c473b1ec0e7f96ccf82abf58cd04e15f
X-Rev: 3bdc4117e35f1cfe9af5d8fe5943fbfca873aa4b
X-Host: ip-10-133-87-231
X-Runtime: 0.122467
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Vary: Origin
Strict-Transport-Security: max-age=31536000
Cache-Control: no-store, private
Date: Fri, 18 Sep 2020 14:42:20 GMT
ETag: W/“058d61c372b01945b1fcd80d7c5aed8f”
Server: nginx/1.19.2
}
IsSuccessStatusCode: true
ReasonPhrase: “OK”
RequestMessage: {Method: GET, RequestUri: ‘https://api.sandbox.freeagent.com/v2/contacts?view=suppliers’, Version: 1.1, Content: , Headers:
{
accept: application/json
user-agent: Mozilla/5.0
user-agent: (Windows NT 10.0; Win64; x64)
user-agent: AppleWebKit/537.36
user-agent: (KHTML, like Gecko)
user-agent: Chrome/83.0.4103.106
user-agent: Safari/537.36
Authorization: Bearer [redacted]
}}
StatusCode: OK
Version: {1.1}

Can I have any updates regarding the same, this my code I call contacts api as below.

var nclient = new HttpClient();
nclient.DefaultRequestHeaders.TryAddWithoutValidation(“Content-Type”, “application/x-www-form-urlencoded”);
nclient.DefaultRequestHeaders.Add(“accept”, “application/json”);

        nclient.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36");
        nclient.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", access_token);
        var nreq = new HttpRequestMessage(HttpMethod.Get, fa_client_req_url + "contacts?view=suppliers");
        var nres = await nclient.SendAsync(nreq);
        string nrep = await nres.Content.ReadAsStringAsync();

Hi Nishit,

I’m afraid I’m not overly familiar with .NET, but the code snippets you’ve provided don’t look like a raw response from our API (which wouldn’t include keys such as HasValues, First, or ChildrenTokens) – they look as if you wrapped the response in some kind of JSON object (JContainer from Json.NET, judging from the structure?) which repeats the value of the response multiple times, but I don’t think the duplicates actually are returned by the API.

Best wishes,

Ewa

It’s happening particular one sandbox company, in another company it’s working fine.