Hi,
I am trying to get results by calling the API Get Tag By Name by passing a request body (getTagByNameRequest) as explained in [1]. By looking at the documentation I cannot figure out what values I should pass with this payload.
{
"maxReturn": 5,
"name": "program",
"offset": 1,
"order": "string"
}
Do you think you can help me out here? Below would be the response I get from Get Tag Types
{
: "success":true,
: "errors":
: [
: ],
: "requestId":"a66a#1631a8a344f",
: "result":
: [
: : {
: : : "tagType":"Author",
: : : "applicableProgramTypes":"[email_batch,program,nurture,event,webinar,in_app]",
: : : "required":false
: : },
: : {
: : : "tagType":"Campaign Topic",
: : : "applicableProgramTypes":"[program,nurture,email_batch,in_app]",
: : : "required":false
: : },
And the result I get from Get Tag by Name by passing the name would be
{
: "success":true,
: "errors":
: [
: ],
: "requestId":"48df#1631a921f88",
: "result":
: [
: : {
: : : "tagType":"Campaign Topic",
: : : "applicableProgramTypes":"[program,nurture,email_batch,in_app]",
: : : "required":false,
: : : "allowableValues":"[xxx,yyy,zzzz,dddd,aaaa]"
: : }
: ]
}
Solved! Go to Solution.
Yes, I think your assumptions are right on.
Maybe the POST variation was intended to allow some other functionality (like a filter by some other characteristic) but it wasn't implemented. More likely it just isn't supposed to be in the docs.
Also, is there a specific reason to support GET with a body in this scenario? I noticed this for some other GET resources as well.Is there a specific reason why these methods are designed this way.
It isn't possible to send a body with a GET (you'd have to use POST and make it a "synthetic" GET by adding _method=GET to the query string).
But I think the docs are wrong here in any case. What would be the purpose of a paginated response, when by definition (unique tag names) there can only be one result by name?
Thanks for the response Sanford. You have a point. If we pass the tag name, it would return only one result and there is no point in passing maxReturn values etc. Therefore, can we conclude that the Marketing documentation is wrong and we should be able to invoke the below resource just by passing a tag name as a query parameter? Can we conclude saying that the getTagByNameRequest Body parameter is not required at all for this resource?
Based on this, we can do our API implementation and inform the front end team about the exact parameters to be passed.
/rest/asset/v1/tagType/byName.json
Yes, I think your assumptions are right on.
Maybe the POST variation was intended to allow some other functionality (like a filter by some other characteristic) but it wasn't implemented. More likely it just isn't supposed to be in the docs.
Awesome! Many thanks for the prompt responses. I will inform the relevant teams accordingly. Hope the documentation will be corrected in future.
Regards,
Evanthika