Update Marketo lead's membership->progressionStatus using REST API - rest

I'm trying to adapt https://github.com/Marketo/REST-Sample-Code/blob/master/php/LeadDatabase/Leads/SyncLeads.php for my own needs. I want to be able to update a lead's status from "Registered" to "Attended" using the REST API. (The Marketo Events app does this when someone is checked into an event.)
However, when I try sending something like:
{"input":[{"email":"asdfasdf#qwerqwer.org",
"membership":{"progressionStatus":"Attended"}}]}
I get back:
{"requestId":"168be#15868ee5bff",
"result":[{"status":"skipped","reasons":[
{"code":"1006","message":"Field 'membership' not found"}]}],
"success":true}
I understand the message just fine -- 'membership' isn't a field, therefore it can't be updated this way. But is there another way to update the progressionStatus using the API?

You need to be looking at that lead's membership of the program - see this method for more information: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/changeLeadProgramStatusUsingPOST

Try to use this format:
{
'status': 'Member',
'input': [
{'id': 23},
{'id': 445}
]
}
You have to use the Marketo Lead ID (not email) and you can only specify 1 status value per API call. Max batch size is 300 Lead IDs.

Related

Microfocus ALM OCTANE REST API - Get existing manual test's step details

I am trying to get existing manual test steps from ALM using the below REST API
https://almoctane-apj.saas.microfocus.com/api/shared_spaces/shared_space_id/workspaces/workspace_id/tests/manual_test_id/script
but I get the following result.
{
"creation_time": "2020-01-16T14:36:52Z",
"test_version": "{\"id\":1035,\"type\":\"test_version\"}",
"version_stamp": 5,
"last_modified": "2020-01-17T09:38:20Z",
"script": "- Open Browser\n- Type Username\n- Type PAssword\n- Submit\n- #2012 Call <ReqTest1>\n- Login using <Username> and <Password>\n- ?isLoginSuccesfull"
}
Is there a way to get existing manual test steps with details(like id, description, etc) through REST API?
i know that is six month late , but you could try calling entity test
http://URLdirection:PORT/api/shared_spaces//workspaces//tests?fields=id,latest_version&query=%22(id%3D%27yourTestId%27)%22
and once you have latest version you can call entity test_versions with attribute last_version that you got in the last request
http://URLdirection:PORT/api/shared_spaces//workspaces//test_versions?fields=id,script&query=%22(id%3D%27yourVersionID%27)%22
and there you will get the steps , also you have to consider that before doing this you need to have stablished connection (requested cookies, etc...) for avoiding 403 error and properly setted headers and parameters for the request. and if you're using microfocus library i didn't find any direct call for test_versions entity
EDIT: also you can request to http://URLdirection:PORT/api/shared_spaces//workspaces//test//script

Custom Dimensions Not Reporting Through to Google Analytics API V4

I am attempting to pass information collected as, "custom dimensions," from Google Tag Manager through Google Analytics and then extract them out via the Google Analytics V4 API.
I have set up four of the fundamental custom dimensions suggested by Simo Ahava in this article.
My variable setup looks like the following:
variable setup
Essentially, I have been able to successfully pass through userID_dimension, hittimestamp_dimension, clientid_dimension and sessionid_dimension to the Google Analytics dashboard, but for some reason I am not able to extract out the hittimestamp_dimension through the API.
Here's what I am able to see on the dashboard:
Google Analytics Dashboard
As far as the API itself, I am using the HelloAnalytics.py python version supplied by Google, and I am able to extract out all of the above information, minus the timestamps dimensions on the right hand side of each.
I'm storing the timestamp information in dimension2, but upon making the below call (again, using API V4) I get blank...nothing.
analytics.reports().batchGet(
body={
'reportRequests': [
{
'viewId': VIEW_ID,
'dateRanges': [{'startDate': '2017-10-05', 'endDate': '2017-10-06'}],
'samplingLevel': 'LARGE',
'dimensions': [{'name': 'ga:dimension4'},{'name': 'ga:dimension2'}]
}]
}
).execute()
Upon making this call, one would expect that the above would report out dimensions similar to what the Google Analytics dashboard would show. E.g. one would think that the dashboard itself is using the API. However what prints out is blank. All other custom dimensions print out as expected.
If I try to call the above function on just dimension2 itself with no other dimension, it is also blank.
Is there something special one has to do in order to extract hit-scoped variables within the API? Or does the API just not allow hit-scoped variables to pass through?
thanks,
You forgot to add a 'metrics' field to your request, it is required as per documentation
Source: Reporting API v4 - Method: reports.batchGet
The metrics requested. Requests must specify at least one metric. Requests can have a total of 10 metrics.
The below modified request should work:
analytics.reports().batchGet(
body={
'reportRequests': [
{
'viewId': VIEW_ID,
'dateRanges': [{'startDate': '2017-10-05', 'endDate': '2017-10-06'}],
'samplingLevel': 'LARGE',
'dimensions': [{'name': 'ga:dimension4'},{'name': 'ga:dimension2'}],
'metrics': [{'expression': 'ga:sessions'}]
}]
}
).execute()

Order /tracks by Like Count

Is it possible in using the Soundcloud Javascript API to order results by like count? Everything I can find says you can no longer order by 'hotness' but nothing about other sorts. I've tried adding an order parameter to my API call such as:
SC.get('/tracks', {
limit: 200,
genres: 'electronic',
order: 'likes_count'
}).then(function(tracks) {
console.log(tracks);
});
But the API call returns a 400 Bad Request, as soon as I remove the order: 'likes_count' line the API call works again.
The order parameter is no longer in the SoundCloud API.

v3 IPP FindAll is not returing the correct paged data when Customers are sub-customers

I'm using the below line:
commonService.FindAll(new Intuit.Ipp.Data.Customer(), currentPage, itemListPageSize).ToList();
When returning multiple pages the paging isn't returning the right rows on page if there are sub-customers. To reproduce, just create several customers and retrieve the second page like:
commonService.FindAll(new Intuit.Ipp.Data.Customer(), 2, itemListPageSize).ToList();
When it retrieves page 2, the first page's data is returned.
Am I doing something wrong?
FindAll with paging actually uses query endpoint.
Please mention if you are trying this call against QBD/QBO.
Can you please capture the raw request and response of the above call and share in this post.
(for that you can enable logger as mentioned in the following docs, or you can configure your app with any http snooper like Fiddler.)
https://developer.intuit.com/docs/0025_quickbooksapi/0055_devkits/0150_ipp_.net_devkit_3.0/logging
You can try this call directly using ApiExplorer. Please verify if you are getting the same result.
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/020_key_concepts/00300_query_operations/0100_key_topics#Pagination
Thanks

Sending Batch Request to Facebook Open Graph Beta

I am trying to submit a batch request to add objects via Open Graph Beta to a user's Timeline but no matter what I do I get this:
The action you're trying to publish is invalid because it does not specify any reference objects. At least one of the following properties must be specified: egg.
I am specifying an egg property though. My requests look like this:
https://graph.facebook.com/?batch=[{'method':'POST','relative_url':'/me/my_namespace:find','egg':'http%3A%2F%2Fwww.mydomain.com%2Fmy_namespace%2Fog%2Fegg.php%3Ftypeid%3D-966','start_time':'1317439270','end_time':'1317439270'}]&access_token=<<snipped>>&method=post
I am sending egg as a url-encoded reference string to a URL that contains my open graph data -- the URL does work if I send it not as a batch but since when setting up a user's Timeline I will in some cases have to post up to 1000 actions I am trying to speed things up by batching them.
I was able to successfully delete via a batch request.
Instead of sending the 'egg' as a param of the batch object, you need to format this like a query string and send it in the body param.
Also, relative_url should not begin with a '/'
Try posting this instead...
https://graph.facebook.com/batch?access_token=TOKEN&method=post&batch=
[
{
"method": "post",
"relative_uri": "me/your_namespace:find",
"body": "egg=http%3A%2F%2Fwww.mydomain.com%2Fmy_namespace%2Fog%2Fegg.php%3Ftypeid%3D-966&start_time= 1317439270&end_time= 1317439270
}
]
I've tested this and it works.
When Posting data to the batch API, the data must be formatted like a querysting and sent in the 'body' param as a string.