redmine create issue assigned_to_id does not work - redmine

i am trying to use the redmine API to create new issue via code,
just to test it i am trying to send the data to the API using postman.
i have used amazon to host it.
I try send json via post method. (using postman -plugin for chrome)
url:- http://{user_name}:{password}#xxxredmine_urlxxx/issues.json
type:- POST
Body:-
{
"issue": {
"project_id": 1,
"subject": "New ticket via API",
"description": "API test 27\/6",
"status_id": 1,
"priority_id": 3,
"assigned_to_id": 5
}
}
it creates a ticket successfully but never sets an assignee
{
"issue": {
"id": 61,
"project": {
"id": 1,
"name": "EasySoft"
},
"tracker": {
"id": 1,
"name": "Bug"
},
"status": {
"id": 1,
"name": "New"
},
"priority": {
"id": 3,
"name": "High"
},
"author": {
"id": 1,
"name": "UserName LastName Admin"
},
"subject": "New ticket via API",
"description": "API test 27/6",
"start_date": "2016-06-27",
"done_ratio": 0,
"custom_fields": [
{
"id": 2,
"name": "Customer name",
"value": ""
}
],
"created_on": "2016-06-27T09:37:58Z",
"updated_on": "2016-06-27T09:37:58Z"
}
}
i have tried changing assigned_to_id to
"assigned_to":{"id":5}
Thank you in advance.

This is an old question but potentially still useful to answer... are you certain that the user you are attempting to set as the assignee is in an assignable role on that specific project? Unfortunately, the Redmine REST API will respond with a 200 OK even if you give it a non-assignable user, so there's no indication that it was unable to successfully set the user as the assignee.

Related

Facebook Graph API Album Endpoint is deprecated?

I am using the graph api (through android SDK and graph explorer) to get a page's posts, when I get to a post of a page that has multiple images in a post it becomes an album.
Example post response
"message": "Test Multi-Photos",
"full_picture": "",
"from": {
"name": "TestPage",
"id": ""
},
"attachments": {
"data": [
{
"media_type": "album",
"media": {
"image": {
"height": 405,
"src": "",
"width": 720
}
},
"type": "album",
"title": "Photos from TestPage's post",
"target": {
"id": "147710857059579",
"url": ""
}
}
]
},
"id": "_147710857059579"
}
When I try to use the target.id to get the album photos
I believe the url would look like this
https://graph.facebook.com/147710857059579
I get a response saying that the endpoint is deprecated
{
"error": {
"message": "(#12) singular statuses API is deprecated for versions v2.4 and higher",
"type": "OAuthException",
"code": 12,
"fbtrace_id": "AhhiY7ohbb5SoXdFNDZnHhU
"
}
}
Documentation does not say anything about it being deprecated so how do you get the album photos?
To get photos from an album post you have to add subattachments to the attachments fields in the query.
Example using the Android SDK
parameters.putString("fields", "message,full_picture,from,place,attachments{media_type,media,type,title,description,target,subattachments}")
parameters.putString("limit", "10")

How can I un-spam my domain while testing mailgun webhooks?

I managed to create all that code that creates mailgun webhooks plus many other things like record responses to local database.
During my tests I send emails to yahoo & gmail and of course - as you expected - I pressed a couple of times the spam button at my tablet's yahoo app to test and verify the events recorded with my code.
My problem is that now when I send to that yahoo address from the domain under test the email never reaches my inbox and at the logs I read:
4.7.0 [TSS04] Messages from 159.135.140.82 temporarily deferred due to user complaints - 4.16.55.1; see https://postmaster.verizonmedia.com/error-codes
See what mailgun reports:
{
"severity": "temporary",
"tags": [
"issue 1",
"newsletter",
"2020"
],
"mailing-list": {
"list-id": "xyz101.mail.mysite.com",
"sid": "1634752",
"address": "xyz101#mail.mysite.com"
},
"storage": {
"url": "https://storage.eu.mailgun.net/v3/domains/mail.mysite.com/messages/AgEFucSTB0eaifXAHzlNKbRoSH0IddfpZA==",
"key": "AgEFucSTB0eaifXAHzlNKbRoSH0IddfpZA=="
},
"delivery-status": {
"tls": true,
"mx-host": "mx-eu.mail.am0.yahoodns.net",
"attempt-no": 1,
"description": "",
"session-seconds": 0.39575695991516113,
"retry-seconds": 600,
"code": 421,
"message": "4.7.0 [TSS04] Messages from 159.135.140.82 temporarily deferred due to user complaints - 4.16.55.1; see https://postmaster.verizonmedia.com/error-codes",
"certificate-verified": true
},
"recipient-domain": "yahoo.co.uk",
"id": "D5IqK77PRA29RvULyzXLsw",
"campaigns": [],
"reason": "generic",
"user-variables": {
"id": "15"
},
"flags": {
"is-routed": false,
"is-authenticated": true,
"is-system-test": false,
"is-test-mode": false
},
"log-level": "warn",
"timestamp": 1604915932.781863,
"envelope": {
"transport": "smtp",
"sender": "sales#mail.mysite.com",
"sending-ip": "159.135.140.82",
"targets": "blah-blah-blah#yahoo.co.uk"
},
"message": {
"headers": {
"to": "cent C. <blah-blah-blah#yahoo.co.uk>",
"message-id": "20201109095852.1.8EC4631A16DA1C10#mail.mysite.com",
"from": "mysite <sales#mail.mysite.com>",
"subject": "test_MailGunHttpClient_send_from_real_domain_with_tags_with_tracking_opens_and_clicks_with_unsubscribe_enabled_and_with_recipient_variables_visible_to_webhooks_to_mailing_list_of_access_type_readonly"
},
"attachments": [],
"size": 2130
},
"recipient": "blah-blah-blah#yahoo.co.uk",
"event": "failed"
}
This message eventually will become severity: "permanent".
Any idea how I can reverse this behavior at yahoo servers not accepting my emails(*)?
(*) For another domain I setup at Mailgun I inspect deliverability as I haven't clicked the spam button for emails landed from that domain
Looks like your actions have had some repercussions, emails from one of our accounts using the same IP are blocked by Yahoo, Aol etc. And it started for no reason related to us, the recipients or the content of the emails (it is a paid newsletter).

Google People API detect merged contacts with syncToken - previousResourceNames not included

I am using the people API to allow users to create entities in my system from their google contacts, via the people API, and am storing the resourceName (i.e 'people/c7760106965272617307') to keep track of the google contact the entity was created from.
I want to be able periodically update the entities to match what is in google. i.e. if the contact updates the phone number the entity gets the updated phone number. So am a calling the list API passing the sync token to get the contacts that have changed since the last call. This works for updates, edits and deletes but I can't find a way to detect when two contacts have been merged in google contacts.
The docs state:
https://developers.google.com/people/api/rest/v1/people#Person.PersonMetadata
previousResourceNames[] Any former resource names this person has had.
Populated only for connections.list requests that include a sync
token.
So if I:
- Call the list API requesting a sync token
- Create Contact A and Contact B
- Call the list API passing the sync token, then I get just the two created contacts and a new sync token:
{
"resourceName": "people/c1465347538402693914",
"etag": "%EgcBAj0JPjcuGgQBAgUHIgxab0lZTFBvUU43bz0=",
"metadata": {
"sources": [
{
"type": "CONTACT",
"id": "1455f5d28afc531a",
"etag": "#ZoIYLPoQN7o=",
"updateTime": "2020-02-26T15:35:34.021Z"
}
],
"objectType": "PERSON"
},
"names": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "1455f5d28afc531a"
}
},
"displayName": "Contact A",
"familyName": "A",
"givenName": "Contact",
"displayNameLastFirst": "A, Contact"
}
]
},
{
"resourceName": "people/c4555919836853785218",
"etag": "%EgcBAj0JPjcuGgQBAgUHIgx2WmJHUUtjNTcxQT0=",
"metadata": {
"sources": [
{
"type": "CONTACT",
"id": "3f39e0f40cd35282",
"etag": "#vZbGQKc571A=",
"updateTime": "2020-02-26T15:35:44.056Z"
}
],
"objectType": "PERSON"
},
"names": [
{
"metadata": {
"primary": true,
"source": {
"type": "CONTACT",
"id": "3f39e0f40cd35282"
}
},
"displayName": "Contact B",
"familyName": "B",
"givenName": "Contact",
"displayNameLastFirst": "B, Contact"
}
}
If I then merge the two contacts, and then call the API passing the new sync token i get:
{
"resourceName": "people/c4555919836853785218",
"etag": "%EgcBAj0JPjcuGgQBAgUHIgxqNlFVYnIwaU9vVT0=",
"metadata": {
"sources": [
{
"type": "CONTACT",
"id": "3f39e0f40cd35282"
}
],
"deleted": true,
"objectType": "PERSON"
}
}
So TDLR; I can find out one of the contacts were deleted, but not that it was merged into another contact.
It seems like the previousResourceNames[] field would do exactly what I want, but I can't seem to make it return in the data, either on the try the API function on the docs:
https://developers.google.com/people/api/rest/v1/people.connections/list
or using the below nodjs code:
const service = google.people({version: 'v1', auth: authClient});
const result = await service.people.connections.list({
resourceName: 'people/me',
personFields: 'names,emailAddresses,phoneNumbers,metadata',
//requestSyncToken: true
syncToken: "insert token here"
});
console.info("Google Returned", JSON.stringify(result.data, null, 4));
I wonder if i need to grant extra scopes, or something else in the requested person fields.
Scopes Requested:
'https://www.googleapis.com/auth/contacts',
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile'

Message property missing from post object retrieved?

I am trying to retrieve all comments of a certain user (not on a specific post but in a general way) using the Graph API.
I have come to understand that I need to query a user's posts and that the result will also contain that user's comments.
I manage to retrieve the list of posts for a specific user and I do see the comments the user posted.
However, the message property is always missing:
{
"id": "100005227004296_112167712300795",
"from": {
"name": "Karen Amebbgkdbif Lausen",
"id": "100005227004296"
},
"story": "\"Karens erster Kommentar zu...\" on Mike Amebkhdchid Letuchysky's photo.",
"story_tags": {
"35": [
{
"id": "100005200843894",
"name": "Mike Amebkhdchid Letuchysky",
"offset": 35,
"length": 27,
"type": "user"
}
]
},
"privacy": {
"value": ""
},
"type": "status",
"application": {
"name": "Photos",
"id": "2305272732"
},
"created_time": "2013-02-17T20:59:52+0000",
"updated_time": "2013-02-17T20:59:52+0000",
"comments": {
"count": 0
}
}
The story property contains a part of the message, but not all of it.
How can I access the full comment (text)?
Thanks in advance!
Alex
You may need to pull back additional properties such as type, status_type and description. If you like a link or comment on something else where and that appears in your timeline it can be returned from the post feed.
Try these fields in the graph API explorer to see what data is returned:
id,created_time,from,message,type,description,story,status_type

list of Page Categories on facebook

I'm developing a facebook search and I would like to list all the page categories (is not relevant but I'm working with koala ruby gem):
A search with type="page" has results like these:
{"category"=>"Community", "name"=>"Koala", "id"=>"7356642860"}
{"category"=>"Product/service", "name"=>"Koala Groupe", "id"=>"188919981197745"}
{"category"=>"Public figure", "name"=>"Cushelle Koala", "id"=>"109202405786555"}
{"category"=>"Dancer", "name"=>"Koala Dance Bots", "id"=>"208563099183596"}
{"category"=>"Musician/band", "name"=>"Kid Koala", "id"=>"17527901121"}
{...}
I'm trying to develop a form to permit the user to achieve a a more precise search.
Then, I would like the user to have a list of categories, but: How to get the facebook pages categories list?
Use the following API to get list of page categories
FB.api(
'/fb_page_categories',
'GET',
{},
function(response) {
// Insert your code here
}
);
You will get response as
{
"data": [
{
"name": "Advertising/Marketing",
"fb_page_categories": [
{
"name": "Advertising Agency",
"id": "164886566892249"
},
{
"name": "Brand Agency",
"id": "1736039333278498"
},
{
"name": "Copywriting Service",
"id": "197029287003787"
},
{
"name": "Digital/Online Marketing Agency",
"id": "1751954525061797"
},
{
"name": "Internet Marketing Service",
"id": "1706730532910578"
},
{
"name": "Marketing Agency",
"id": "123377808095874"
},
{
"name": "Marketing Consultant",
"id": "170992992946914"
},
{
"name": "Media Agency",
"id": "281507032196735"
},
{
"name": "Public Relations Agency",
"id": "192021210817573"
},
{
"name": "Social Media Agency",
"id": "530553733821238"
},
{
"name": "Telemarketing Service",
"id": "197557456921449"
}
],
"id": "1757592557789532"
}
and so on....
There is a similar question here:
Authoritative List of all Facebook Subcategories
that I responded to. Hope this helps.
A standard Graph API call would be:
https://graph.facebook.com/v2.10/fb_page_categories?access_token={access_token_obfuscated}