Google Tag Manager

Forum Discussion

LouisAlston's avatar
LouisAlston
Collaborator
10 months ago

JSON body arrays in connected content API calls

Currently building out some complex connected content use cases.

Many APIs require arrays in the request, however I haven't able to make these types of requests in Braze.

I would like to make a request with this body structure:

{
  "model": "sonar-pro",
  "messages": [
    {
      "role": "system",
      "content": "Be precise and concise."
    },
    {
      "role": "user",
      "content": "How many stars are there in our galaxy?"
    }
  ],
  "max_tokens": 123,
  "temperature": 0.2
}

For context, this is a request to Perplexity API.

So far, in testing through webhook.site I haven't been able to properly make this request. I have gotten close using some complex url-encoding but its not 100%. 

Is there any known limitation of using arrays within the body of requests or a solution/workaround to this issue?

Cheers!

No RepliesBe the first to reply