It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Setting up POST Service - receive-hook data not formatting?

Hey. I'm new to both BitBucket and to git, and I'm struggling. I've got a simple POST service I'm trying to setup based on this code: (walk-through: & code:

It's not firing, and I've managed to work out why - the data in the $_POST variable isn't being accessed correctly. I've setup a `mail` function to email me the output and when I run `implode(',', $_POST)` and output the data, I get this in return:

{\"repository\": {\"website\": \"\", \"fork\": false, \"name\": \"test\", \"scm\": \"git\", \"owner\": \"me\", \"absolute_url\": \"/me/test/\", \"slug\": \"test\", \"is_private\": true}, \"user\": \"me\", \"truncated\": false, \"commits\": [{\"node\": \"5347dd04bbfd\", \"files\": [{\"type\": \"modified\", \"file\": \"index.html\"}], \"branch\": \"master\", \"utctimestamp\": \"2013-05-25 01:11:41+00:00\", \"timestamp\": \"2013-05-25 03:11:41\", \"raw_node\": \"5347dd04bbfd7c63e380985a5878dd3f34275994\", \"message\": \"testing remote push\\n\", \"size\": -1, \"author\": \"me\", \"parents\": [\"56eda188f077\"], \"raw_author\": \"My Name <>\", \"revision\": null}], \"canon_url\": \"\"}

This doesn't look right and it also means that when i try to access $_POST['payload'] or any other variable combo, it's coming up empty.

What am I doing wrong??

1 answer

Hi Tiffani,

Have you emailed the owner of that github repo? Looks like he responds to posts on the blog.


thanks for replying. I have emailed him with nothing back yet. I thought I'd ask here, as the question really didn't involve the code that was being questioned. I put the email and output at the very beginning of the code, so that the first thing that happens is the output to email and the $_POST data isn't coming through like i'd expect. I can't figure out how to get the POST data out into a usable format. The problem is actually separate to the rest of the code.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Europe

Daniel Meisen, kreuzwerker, Video and Slides online

Video and slides from this week's Monday Night Special are online. Learn more about the differences between Atlassian Server/Data Center and Atlassian Cloud from Daniel Meisen, kreuzwerker, and find ...

19 views 0 0
View post

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you