XF 2.2 Save a metadata on a post

I'm a web developer but this is the first time I've touched a Xenforo addon that I would like to modify.
I need help with two basic things:
  • a script makes a request to the discord API that returns an ID that I want to save in the Xenforo thread data (the ID is related to the thread)
  • a script makes another request and uses this previously saved ID as a parameter to send it as a parameter to the request.

My question is only about saving the metadata in Xenforo and retrieving it, that's all!

Here is an example of the discord API return: https://prnt.sc/IiqXLqErW8ED

Thanks for your help