Community
Showing results for 
Search instead for 
Do you mean 
Reply

Error 400 : POST

Highlighted
New Member
Posts: 2
Country: USA

Error 400 : POST

Hi,

 

When I POST to /api/Activities I get an error 400.

 

This is what I'm trying to post :

{'activityTypeName': 'Call', 'isTimeless': 'false', 'scheduledFor': 'Admin', 'subject': 'ACT4Telephony: out', 'contacts': [{'id': '9d5089d5-08da-4a1f-87c4-37184eefb55c'}, {'id': 'e228dfa1-2fba-4b7f-b0aa-9c16a9219576'}], 'startTime': '2016-05-04T17:21:50+00:00', 'details': 'http://konexim01.konexim.net/admin/config.php?display=cdr&action=download_audio&cdr_file=1462382510.263', 'isPrivate': 'false', 'scheduledBy': 'Admin', 'activityPriorityName': 'Low', 'endTime': '2016-05-04T17:22:31+00:00'}

This is the answer that I get : 

{
  "occurrence": [
    ""
  ]
}

But when I paste the same data in the web interface of the API (page : /Act.Web.API/swagger/index.html#/) it's working.

 

 

I don't know where to look to fix the problem. I tried everything and I can't figure it out.

 

Thank you for your help.

Highlighted
Nickel Contributor
Posts: 175
Country: USA

Re: Error 400 : POST

Have you tried double quotes ( " ) instead of single ( ' ) around your values? I'm pretty sure the double is the valid character and single may or may not work depending on library used to read the JSON.

Highlighted
New Member
Posts: 2
Country: USA

Re: Error 400 : POST

Hi,

I've tried with double quotes and it's doing the same error.

Thank you,

Highlighted
New Member
Posts: 1
Country: USA

Re: Error 400 : POST

Same errors :<

[url=http://www.magestore.com/magento-2-social-login-extension.html/]Magento 2 Social Login[/url] / [url=http://www.magestore.com/magento-2-mega-menu-extension.html/]Magento 2 Mega Menu[/url]
Highlighted
Employee
Posts: 123
Country: USA

Re: Error 400 : POST

The JSON looks good.  I just posted the JSON to my database, the only thing I changed was single quotes to double and the contact ids to match my database. 

 

  *  Are you on API version 1.0.80.0?

  *  Can you validate the contact GUIDS you posted in your example are still valid?

 

{
	"activityTypeName": "Call",
	"isTimeless": "false",
	"scheduledFor": "Admin",
	"subject": "ACT4Telephony: out",
	"contacts": [
		{
			"id": "1f314136-bee9-4c9b-8321-ce11fd6a1d66"
			
		},
		{
			"id": "16ff902b-43d2-4540-8902-815ffe883212"
		}
	],
	"startTime": "2016-05-04T17:21:50+00:00",
	"details": "http://konexim01.konexim.net/admin/config.php?display=cdr&action=download_audio&cdr_file=1462382510.263",
	"isPrivate": "false",
	"scheduledBy": "Admin",
	"activityPriorityName": "Low",
	"endTime": "2016-05-04T17:22:31+00:00"
}