Best answer

How to format destination id into a Webhooks POST request to Onfleet


Userlevel 2
Badge +1

I am trying to create a destination ID using the POST webhook, but it seems my formatting is incorrect. Can anyone help me here?

This is what I need to post

{
"destination": {
"address": {
"number": "2500",
"street": "North Hollywood Way",
"city": "Burbank",
"postalCode": "91505",
"state": "CA",
"country": "United States"
},
"location": [-118.347876, 34.194036]
}
}

 

 

icon

Best answer by Troy Tessalone 12 May 2021, 19:25

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

Userlevel 7
Badge +14

Hi @chrisfinck

Try using the Custom Request option, then selecting the POST method, which will allow you to format the entire Data as JSON.

 

Userlevel 2
Badge +1

Hi @chrisfinck

Try using the Custom Request option, then selecting the POST method, which will allow you to format the entire Data as JSON.

 

 

Userlevel 7
Badge +14

@chrisfinck 

Try copying pasting the entire JSON code as is with all the opening and closing bracket { }

 

Userlevel 2
Badge +1

@chrisfinck

Try copying pasting the entire JSON code as is with all the opening and closing bracket { }

 

Im referencing this https://docs.onfleet.com/reference#create-destination which shows the above as the response but not the request

Userlevel 7
Badge +14

@chrisfinck 

Try this format...

REQUEST

{
"address":
{
"number":"543",
"street":"Howard St",
"apartment":"5th Floor",
"city":"San Francisco",
"state":"CA",
"country":"USA"
},
"notes":"Don\'t forget to check out the epic rooftop."
}

 

RESPONSE

{
"id": "JLn6ZoYGZWn2wB2HaR9glsqB",
"timeCreated": 1455156663000,
"timeLastModified": 1455156663896,
"location": [
-122.3965731,
37.7875728
],
"address": {
"apartment": "5th Floor",
"state": "California",
"postalCode": "94105",
"country": "United States",
"city": "San Francisco",
"street": "Howard Street",
"number": "543"
},
"notes": "Don't forget to check out the epic rooftop.",
"metadata": []
}

 

Userlevel 2
Badge +1

That did it thank you!