API3
subakva at July 16th, 2014 15:47 — #1
I'm working on integrating a contact form with the OnePage API. This morning I tried to creating a contact and received an Internal Server Error. Now, when I try to access the app in the browser I also get an Internal Server Error.
API requests for other resources, like tags, users and lead_sources still work correctly.
The request that appeared to trigger it looked something like this:
POST https://app.onepagecrm.com/api/v3/contacts.json
Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
Accept: /User-Agent: Ruby
Host: app.onepagecrm.com
Content-Type: application/json; charset=utf-8
X-OnePageCRM-UID: [an admin user id]
X-OnePageCRM-TS: 1405539491
X-OnePageCRM-Auth: [message signature]
{
"type": "company",
"status": "lead",
"lead_source_id": "53c6c054aa76204337000004",
"background": "Description:\nLater, as he sat on his balcony...\n\nProduct Name: Zero G Bagel Slicer",
"first_name": "Dexter",
"last_name": "Rimirez",
"company_name": "Deep Space Bagels",
"emails": [
{
"type": "work",
"value": "dsbagels@example.com"
}
],
"address_list": {
"city": "San Francisco",
"state": "CA"
}
}
pete_onepagecrm at July 17th, 2014 03:51 — #2
Hi @subakva thanks for getting in touch.
I've tried to replicate your call on my end, and while I have been able to get a 500 error with this request, it hasn't broken the web app.
Your address list is not formatted correctly, it should be an array of values, something like this:
{
"type": "company",
"status": "lead",
"lead_source_id": "53c6c054aa76204337000004",
"background": "Description:\nLater, as he sat on his balcony...\n\nProduct Name: Zero G Bagel Slicer",
"first_name": "Dexter",
"last_name": "Rimirez",
"company_name": "Deep Space Bagels",
"emails": [
{
"type": "work",
"value": "dsbagels@example.com"
}
],
"address_list": [
"city": "San Francisco",
"state": "CA"
]
}
Obviously we shouldn't be sending 500 errors for a simple mistake for this, I'll look into it ASAP.
Are you still getting a 500 error for the web app?
pete_onepagecrm at July 17th, 2014 05:08 — #3
Hi Jason, did you create a lead source before creating this contact?
We think that may be the cause of the problem.
Can you post the call you made to create this lead source?
pete_onepagecrm at July 17th, 2014 05:18 — #4
Jason, looks like there is some malformed data in the lead source that you created.
Can you make a PUT
to:
lead_sources/53c6c054aa76204337000004.json
with a body like:
{
"text" : "some_string"
}
This will override the malformed data in the lead source text.
We have a fix ready to make sure this can't happen again.
Sorry for the inconvenience!
Powered by Discourse, best viewed with JavaScript enabled