#radu-dev_webhooks

1 messages ยท Page 1 of 1 (latest)

restive roseBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1359464652760944672

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

remote prism
summer gulch
#

Hi, let me help you with this.

#

Could you please explain the problem in more detail?

remote prism
#

string(163) "{"cId":"10033","cUId":"u1Z0Aw0oGwiFH1qOylFTM3GwMmynTgP9LrHXBVIgFgk/0VNXjDI5PorkNSDV5oB9mj0=","sId":"rttIYdBZxKX5SDQTX5uKraj+mkdcaWzAbIZtWZU4LjyYCKB3AmvDUxuTpQ=="}"

#

Hi. as you can see here in the first message with the illegal offset, it's says that somehow metadata is not existing in param.data.object.metadata

#

but when i resend the req to our endpoint

#

the metadata is there

#

Am i missing something?

#

This is the payload

restive roseBOT
summer gulch
#

Could you please share the code of your webhook endpoint?

remote prism
#

$parameters = $this->commonService->tryJsonDecode($request->getContent(), true);

    if(!array_key_exists('data', $parameters ) || !array_key_exists('object', $parameters['data']) || !array_key_exists('metadata', $parameters['data']['object']) || !array_key_exists('cUId', $parameters['data']['object']['metadata']) || empty($parameters['data']['object']['metadata']['cUId']))
    {
        return new JsonResponse(array(
            'success'=>false,
            'message'=>'Metadata is missing!',
        ), Response::HTTP_BAD_REQUEST);
    }
heady compass
#

Well I suspect that array_key_exists is the issue as data[object][metadata] is not an array

#

That's probably the code that throws the error

remote prism
#

we tried accessing metadata as object from data[object] and it says is not an object