Announcements endpoints

The Announcements endpoints enable you to work with Gtmhub announcements. You can work with existing announcements, create new announcements, update or delete them.

DEPRECATED
🔗
get
/announcements
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Gets all announcements that match the specified filters Use the ?fields= query string parameter to control the response.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
formattingstringThe formatting used for the comment. By default it is returned as 'mentionsMarkup' and it can contain markdown and special markup for mentioned people. Use 'plainText' if you want the response without markdown and special markup.
expected in query, sample value:
string
Expected response codes
200announcementsResponse
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/announcements?formatting=string' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements?formatting=string", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements"



requests.get(url, headers = headers)
{
    "items": [
        {
            "announcementTargetId": "string value",
            "announcementType": "string value",
            "author": {
                "accountId": "string value",
                "dateCreated": "string value",
                "email": "string value",
                "firstName": "string value",
                "id": "string value",
                "language": "string value",
                "lastName": "string value",
                "name": "string value",
                "picture": "string value"
            },
            "authorId": "string value",
            "comment": "string value",
            "dateCreated": "string value",
            "id": "string value",
            "notificationStrategy": "string value",
            "notify": [
                "string value 1",
                "string value 2"
            ]
        }
    ],
    "totalCount": 2
}
DEPRECATED
🔗
get
/announcements/{id}
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Gets a single announcement based on the specified id
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the announcement.
expected in path, sample value:
5be26318e5274a0007f17f61
formattingstringThe formatting used for the comment. By default it is returned as 'mentionsMarkup' and it can contain markdown and special markup for mentioned people. Use 'plainText' if you want the response without markdown and special markup.
expected in query, sample value:
string
Expected response codes
200announcementResponse
401unauthorized

curl -X GET 'https://app.gtmhub.com/api/v1/announcements/{id}?formatting=string' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements/{id}?formatting=string", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements/{id}"



requests.get(url, headers = headers)
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "author": {
        "accountId": "string value",
        "dateCreated": "string value",
        "email": "string value",
        "firstName": "string value",
        "id": "string value",
        "language": "string value",
        "lastName": "string value",
        "name": "string value",
        "picture": "string value"
    },
    "authorId": "string value",
    "comment": "string value",
    "dateCreated": "string value",
    "id": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}
DEPRECATED
🔗
post
/announcements
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Creates an announcement in the current gtmhub account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
announcement
*
object
expected in body, sample value:
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "authorID": "string value",
    "comment": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}
Expected response codes
201announcementResponse
401unauthorized

curl -X POST 'https://app.gtmhub.com/api/v1/announcements' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"announcementTargetId":"string value","announcementType":"string value","authorID":"string value","comment":"string value","notificationStrategy":"string value","notify":["string value 1","string value 2"]}'

var body ={ "announcementTargetId": "string value", "announcementType": "string value", "authorID": "string value", "comment": "string value", "notificationStrategy": "string value", "notify": [ "string value 1", "string value 2" ] };

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements"

body = { "announcementTargetId": "string value", "announcementType": "string value", "authorID": "string value", "comment": "string value", "notificationStrategy": "string value", "notify": [ "string value 1", "string value 2" ] };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "author": {
        "accountId": "string value",
        "dateCreated": "string value",
        "email": "string value",
        "firstName": "string value",
        "id": "string value",
        "language": "string value",
        "lastName": "string value",
        "name": "string value",
        "picture": "string value"
    },
    "authorId": "string value",
    "comment": "string value",
    "dateCreated": "string value",
    "id": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}
DEPRECATED
🔗
post
/announcements/{id}/react
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Creates a reaction to the specified announcement.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the announcement.
expected in path, sample value:
5be26318e5274a0007f17f61
reaction
*
object
expected in body, sample value:
{
    "reactionId": "string value"
}
Expected response codes
200announcementResponse
401unauthorized

curl -X POST 'https://app.gtmhub.com/api/v1/announcements/{id}/react' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"reactionId":"string value"}'

var body ={ "reactionId": "string value" };

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements/{id}/react", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements/{id}/react"

body = { "reactionId": "string value" };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "author": {
        "accountId": "string value",
        "dateCreated": "string value",
        "email": "string value",
        "firstName": "string value",
        "id": "string value",
        "language": "string value",
        "lastName": "string value",
        "name": "string value",
        "picture": "string value"
    },
    "authorId": "string value",
    "comment": "string value",
    "dateCreated": "string value",
    "id": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}
DEPRECATED
🔗
patch
/announcements/{id}
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Updates the specified announcement.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the announcement.
expected in path, sample value:
5be26318e5274a0007f17f61
announcement
*
object
expected in body, sample value:
{
    "comment": "string value"
}
Expected response codes
200announcementResponse
401unauthorized

curl -X PATCH 'https://app.gtmhub.com/api/v1/announcements/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"comment":"string value"}'

var body ={ "comment": "string value" };

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements/{id}", "method": "PATCH", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements/{id}"

body = { "comment": "string value" };

requests.patch(url, data=json.dumps(body), headers = headers)
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "author": {
        "accountId": "string value",
        "dateCreated": "string value",
        "email": "string value",
        "firstName": "string value",
        "id": "string value",
        "language": "string value",
        "lastName": "string value",
        "name": "string value",
        "picture": "string value"
    },
    "authorId": "string value",
    "comment": "string value",
    "dateCreated": "string value",
    "id": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}
DEPRECATED
🔗
delete
/announcements/{id}
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Deletes an announcement based on the provided id.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the announcement.
expected in path, sample value:
5be26318e5274a0007f17f61
Expected response codes
204no content
401unauthorized

curl -X DELETE 'https://app.gtmhub.com/api/v1/announcements/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements/{id}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements/{id}"



requests.delete(url, headers = headers)
DEPRECATED
🔗
delete
/announcements/{id}/react
This endpoint is deprecated as of March 15, 2022. For more information see [Gtmhub to sunset Announcements functionality](https://gtmhub.com/blog/gtmhub-sunsets-announcements-functionality)
Deletes a reaction from an announcement.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the announcement.
expected in path, sample value:
5be26318e5274a0007f17f61
Expected response codes
200announcementResponse
401unauthorized

curl -X DELETE 'https://app.gtmhub.com/api/v1/announcements/{id}/react' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/announcements/{id}/react", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/announcements/{id}/react"



requests.delete(url, headers = headers)
{
    "announcementTargetId": "string value",
    "announcementType": "string value",
    "author": {
        "accountId": "string value",
        "dateCreated": "string value",
        "email": "string value",
        "firstName": "string value",
        "id": "string value",
        "language": "string value",
        "lastName": "string value",
        "name": "string value",
        "picture": "string value"
    },
    "authorId": "string value",
    "comment": "string value",
    "dateCreated": "string value",
    "id": "string value",
    "notificationStrategy": "string value",
    "notify": [
        "string value 1",
        "string value 2"
    ]
}