Creating a signature with JSON paramters


I’m trying to trigger a tailored audience request.

I was able to create an empty tailored audience but I’m unable to successfully call the ‘tailored audience users’ in order to push users into this empty audience.
I went over the documentation in the following URL and can’t find what am I doing wrong
I’m getting the following error:

"message":"This request is not properly authenticated"

I suspect the issue is with creating the OAuth signature for the call.
Since both the ‘params’ and ‘users’ parameters are of type JSON I’m not sure if I should include them in the signature base string and if yes how exactly?

Hello, @Vajrakaya, and welcome!
It sounds like the issue is with the POST accounts/:account_id/tailored_audiences/:tailored_audience_id/users endpoint. Since the TA create request is successful, I imagine the issue might be with not encoding reserved characters. Please see the following post:

Please let us know if, after making the adjustments listed in that post, you’re able to update the audience with users.

Hey @Vajrakaya ,
Did you set Content-Type: application/json request header for the POST request? I guess that’s the missing piece here.

Hi @Ananya, @Spriha.
The header is indeed set with ‘Content-Type: application/json’.
I also checked the encoding and I can’t find any problem with it.

This is the request body for example:

    "operation_type": "Update",
    "params": {
      "effective_at": "2018-05-15T00:00:00Z",
      "expires_at": "2019-01-01T07:00:00Z",
      "users": [
          "email": [
          "phone_number": [
          "email": [
          "phone_number": [

And this is my encoded signature base string (without keys)


Shouldn’t this work? I’m still getting the same error…
Thank you,


@Vajrakaya since you’re trying to send a JSON body data not a form encoded, it should not be included in the base string as per OAuth spec.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.