ciaranmccormick / hootsweet Goto Github PK
View Code? Open in Web Editor NEWA Python API for Hootsuite
A Python API for Hootsuite
/v1/messages/{messageId}/history
messageId
required{
"data": {
"actions": [
{
"actorType": "MEMBER",
"actorId": "12345678",
"actionType": "CREATE",
"timestamp": "2017-02-15T18:51:13.000Z"
}
]
}
}
delete_message API doesn't return a 'data' attribute on success, hence the error.
"/Users/gghildyal/ito/projects/gitops/disruption_messaging/disruption_messaging/social/hootsuite.py", line 125, in schedule_message
self.delete_message()
File "/Users/gghildyal/ito/projects/gitops/disruption_messaging/disruption_messaging/social/hootsuite.py", line 144, in delete_message
self.client.delete_message(self.message_id)
File "/Users/gghildyal/ito/projects/gitops/disruption_messaging/venv/lib/python3.7/site-packages/hootsweet/api.py", line 243, in delete_message
return self._make_request(resource, method="DELETE")
File "/Users/gghildyal/ito/projects/gitops/disruption_messaging/venv/lib/python3.7/site-packages/hootsweet/api.py", line 107, in _make_request
return response.json()["data"]
File "/Users/gghildyal/ito/projects/gitops/disruption_messaging/venv/lib/python3.7/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
/v1/organizations/{organizationId}/members/{memberId}/socialProfiles
organisationId
required{
"data": [
{
"id": "115185509"
}
]
}
When a new tag is pushed to the repository, test the build, build the package and automatically push to pypi.
/v1/organizations/{organizationId}/members/{memberId}
organisationId
requiredmemberId
required{
"data": {}
}
/v1/organizations/{organizationId}/members/{memberId}/socialProfiles/{socialProfileId}/permissions
organisationId
required{
"data": {
"permissions": [
"BASIC_USAGE"
],
"permissionPreset": "EDITOR"
}
}
/v1/comments/{commentId}/reject
commentId
requiredparameter
reason
**required (string)sequenceNumber
required (integer)reviewerType
(string) EXTERNAL or MEMBER{
"reason": "Message contains profanity",
"sequenceNumber": 11,
"reviewerType": "EXTERNAL"
}
/v1/messages
organisationId
requiredstartTime
required (ISO-8601 format)endTime
required (ISO-8601 format)state
(string: PENDING_APPROVAL, REJECTED, SENT, SCHEDULED and SEND_FAILED_PERMANENTLY)socialProfileIds
(integer)limit
(integer) defaults to 50, maximum is 100cursor
(string) cursor to a specific page in the results, defaults to the first{
"data": [
{
"id": "4138476039",
"state": "SCHEDULED",
"text": "5 trends that will change how we use social media this year http://owl.li/YuNr2",
"socialProfile": {
"id": "115185509",
"externalURL": "https://www.linkedin.com/in/l-lhs-8654321"
},
"scheduledSendTime": "2018-10-25T10:35:00Z",
"webhookUrls": [
"https://myserver.com/inbound"
],
"tags": [
"test_tag"
],
"targeting": {
"facebookPage": {
"ageMin": 45,
"education": [
"collegeGrad"
],
"interestedIn": [
"female"
],
"relationshipStatus": [
"single"
],
"countries": [
{
"k": "Canada",
"v": "CA"
}
],
"regions": [
{
"k": "British Columbia",
"v": "2"
}
],
"cities": [
{
"k": "Burnaby, BC",
"v": "292466"
}
],
"zips": [
{
"k": "K1S",
"v": "CA:K1S"
}
]
},
"linkedInCompany": {
"companySize": [
"51-200"
],
"geography": [
"as.jp"
],
"industry": [
"41"
],
"jobFunction": [
"qa"
],
"seniority": [
"en"
]
}
},
"privacy": {
"facebook": {
"visibility": [
"everyone"
]
},
"linkedIn": {
"visibility": [
"anyone"
]
}
},
"location": {
"latitude": 57.64911,
"longitude": 10.40744
},
"emailNotification": true,
"mediaUrls": [
{
"thumbnailUrl": "http://static.ow.ly/photos/thumb/cS5.jpg",
"url": "http://static.ow.ly/photos/normal/cS5.jpg"
}
],
"media": [
{
"id": "aHR0cDovL2V4YW1wbGUub3Jn",
"thumbnailId": "aHR0cDovL2V4YW1wbGUtMDAwMS5vcmc=",
"videoOptions": {
"facebook": {
"title": "My Video",
"category": "ENTERTAINMENT"
}
}
}
],
"extendedInfo": [
{
"socialProfileType": "PINTEREST",
"socialProfileId": "123456789",
"data": {
"boardId": "123456789012345678",
"destinationUrl": "https://www.hootsuite.com"
}
}
],
"postId": "705207140236001282",
"postUrl": "https://www.facebook.com/177463958820/posts/10155617296368821",
"createdByMember": {
"id": "1389211223"
},
"lastUpdatedByMember": {
"id": "1389211222"
},
"sequenceNumber": 3
}
],
"metadata": {
"cursor": {
"next": "1577887200000:4138476039:0",
"previous": "1577887200000:4138476039:1"
}
}
}
/v1/organizations/{organizationId}/members
organisationId
required{
"data": [
{
"id": "15240789"
}
]
}
I'm having an issue whereby an image uploaded to URL sits in "QUEUED" and never reaches "READY".
I'm following the Messages with Media portion - https://github.com/ciaranmccormick/hootsweet#messages-with-media
/v1/comments/{commentId}
commentId
required{
"data": {
"comment": "This is an example comment.",
"createdDate": "2019-01-24T00:51:33.000Z",
"creatorId": "12345",
"creatorName": "Joe Smith",
"id": "4138476039",
"parentId": "126123123_12314",
"parentType": "POST",
"reviewState": "COMPLETED",
"sequenceNumber": 3,
"socialProfileId": "12345"
}
}
/v1/messages/{messageId}/reject
messageId
requiredreason
required (string)sequenceNumber
required (string)reviewerType
(string) one of EXTERNAL or MEMBER{
"data": {}
}
/v1/organizations/{organizationId}/members/{memberId}/permissions
organisationId
requiredmemberId
required{
"data": {
"permissions": [
"ORG_MANAGE_MEMBER"
],
"permissionPreset": "CUSTOM"
}
}
/v1/comments/{commentId}/approve
commentId
requiredparameter
sequenceNumber
required (integer)reviewerType
(string) one of EXTERNAL or MEMBER{
"data": {}
}
/v1/organizations/{organizationId}/teams
organizationId
required{
"data": [
{
"id": "359493",
"name": "North America Support Team",
"logoUrl": "http://ow.ly/i/logo.png",
"createdDate": "2016-01-14T16:27:40Z",
"createdByMember": {
"id": "13892119232"
},
"modifiedDate": "2016-01-14T16:27:40Z",
"modifiedByMember": {
"id": "13892119232"
}
}
]
}
/v1/organizations/{organizationId}/members/{memberId}/teams
organisationId
requiredmemberId
required{
"data": [
{
"id": "359493"
}
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.