AD BUDGET PRICING URL FORMATION - api

For some reason I'm not able to get the response for the API for Ad Budget Pricing from the document attached herewith https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ad-budget-pricing?tabs=http
This is the sample encoded url given in the doc and we want to build the same api for our use-case:
GET https://api.linkedin.com/v2/adBudgetPricing?account=urn%3Ali%3AsponsoredAccount%3A1245678&bidType=CPM&optimizationTargetType=MAX_CLICK&objectiveType=WEBSITE_VISIT&campaignType=SPONSORED_INMAILS&matchType=EXACT&q=criteriaV2&&targetingCriteria=(include:(and:List((or:(urn%3Ali%3AadTargetingFacet%3AstaffCountRanges:List(urn%3Ali%3AstaffCountRange%3A%28501%2C1000%29))))))&dailyBudget=(amount:300,currencyCode:USD)
We have tried hitting(by using our own values from responses and replacing above):
https://api.linkedin.com/v2/adBudgetPricing?account=urn%3Ali%3AsponsoredAccount%3A{sponsored_acc_id}&bidType=CPM&campaignType=SPONSORED_UPDATES&q=criteriaV2&targetingCriteria=(include:(and:List((or:({urn%3Ali%3AadTargetingFacet%3AinterfaceLocales}:List({urn%3Ali%3Alocale%3Aen_US}))))))
We are picking our values for targetingCriteria from here(response of Campaigns) and are probably facing some issue with this field only:
"storyDeliveryEnabled": false,
"targetingCriteria": {
"include": {
"and": [
{
"or": {
"urn:li:adTargetingFacet:interfaceLocales": [
"urn:li:locale:en_US"
]
}
},
Can someone please look at the above and help us build this url correctly or check why we're facing issue building this. Are we missing something.Or are we replacing our values for targetingCriteria incorrectly? ANY HELP IS HIGHLY APPRECIATED.
Thanks.

Related

How to pass dynamic JSON data in Jmeter while doing performance Testing?

I'm new to Jmeter, and working on load test, I did couple of samples and that are running fine, Now I'm facing a Issue at below point.
Issue: How do I pass the variable in JSON body part?for few request we've a body and the body should change as per the input data, Ex: username and email, etc,.
I used ${name} kind of variable in Jmeter, but it's not working. Could you please suggest us the better way to rid out this issue.
Note: Please, refer the screenshot, where I wants to put a variable and that should come from user defined variables.
click here to see image
Thanks in Advance,
Rajesh B
Jmeter version: 5.1
Windows 10
{
"unitNumber": "111",
"bathRooms": 1,
"price": 50,
"basePrice": 50,
"streetAddress": "${ADDRESS}",
"city": "Washington",
"state": "CO",
"address": "${ADDRESS_2}",
"addressId": 2,
"contactPreferedValue": "Email",
"weekSelected": "1",
"cleaningWeekSelected": "1",
"email": "${Email}",
"mobile": "",
"weekSelectedValue": "May 30 2019",
"keypadPasscode": false,
"contactValue": "I'll be at home",
"contactPrefered": 1,
"isPaymentDone": false
}
Expected result: Jmeter Script (JSON Body) should allow to read dynamic data from user defined variables.
Please check you plan is same as below:-
Hope this help.
Update:-
It is the same logic. I have used your json in http request body and used user defined variable. I have got the below output.
Use JSON Extractor from Post Processor to parse the JSON and store the value in a variable. Once you do that you can use the variable in required places
Please check the link bellow for details
https://www.blazemeter.com/blog/api-testing-with-jmeter-and-the-json-extractor

How can I access columns.roles in Power BI development?

Could not find this answer online, so decided to post the question then the answer.
I created a table in the capabilities.json file:
"dataRoles": [
{
"displayName": "Stakeholders",
"name": "roleIwant",
"kind": "GroupingOrMeasure"
}
...
"dataViewMappings": [
{
"table": {
"rows": {
"select": [
{
"for": {
"in": "roleIwant"
}
}
]
}
}
}
]
I realized that I could not simply set, for instance, legend data from the first category, because the first category comes from the first piece of data the user drags in, regardless of position. So if they set a bunch of different pieces of data in Power BI online, for instance, then remove one, the orders of everything get messed up. I thought the best way to settle this would be to identify the role of each column and go from there.
When you click on show Dataview, the hierarchy clearly shows:
...table->columns[0]->roles: { "roleIwant": true }
So I thought I could access it like:
...table.columns[0].roles.roleIwant
but that is not the case. I was compiling using pbiviz start from the command prompt, which gives me an error:
error TYPESCRIPT /src/visual.ts : (56,50) Property 'roleIwant' does not exist on type '{ [name: string]: boolean; }'.
Why can I not access this in this way? I was thinking because natively, roles does not contain the property roleIwant, which is true, but that shouldn't matter...
The solution is actually pretty simple. I got no 'dot' help (typing a dot after roles for suggestions), but you can use regular object properties for roles. The command for this case would be:
...table.columns[0].roles.hasOwnProperty("roleIwant")
And the functional code portion:
...
columns.forEach((column) =>{
if(column.roles.hasOwnProperty("roleIwant")){
roleIwantData = dataview.categorical.categories[columns.indexOf(column)].values;
})
If it has the property, it belongs to that role. From here, the data saved will contain the actual values of that role! The only thing I would add on here is that if a column is used for multiple roles, depending on how you code, you may want to do multiple if's to check for the different roles belonging to a column instead of if else's.
If anyone has any further advice on the topic, or a better way to do it, by all means. I searched for the error, all over for ways to access columns' roles, and got nothing, so hopefully this topic helps someone else. And sorry for the wordiness - I tend to talk a lot.

Azure Search API does not find indexed document despite correct query

Using Azure Search REST API v2016-09-01, the following query find the expected document:
?queryType=full&search=id:3119443 AND name:du*
{
"value": [
{
"#search.score": 4.425995,
"id": "3119443",
"name": "dupond"
}
]
}
Whereas the following broader query (searching d* instead of du*) does not find the same document:
?queryType=full&search=id:3119443 AND name:d*
{
"value": []
}
The name field uses a custom analyzer with the Whitespace tokenizer and the WordDelimiterTokenFilter, AsciiFoldingTokenFilter and Lowercase token filters.
Most of the indexed documents are correctly found when searching their first name letter.
The issue is 100% reproducible on those specific documents, for which I don't find anything special.
The Search Service is a "Standard" tier (1 replica, 1 partition, 1 search unit), with the index containing 3,000,000+ documents.
Thank you.
Thanks for reporting the issue. As commented, this is a regression introduced in a recent change. The bug has been fixed. Thanks.

RavenDB Authorization Bundle proper user of SecureFor

I am attempting to use RavenDB's authorization bundle to limit the results of a query (on WorkItems) by the permissions that have been explicitly set on WorkItem documents.
For example:
I have a user bob#bob.com with a userId of /users/1 and a WorkItem that has the following permissions set in the Meta-Data:
"Raven-Document-Authorization": {
"Tags": [],
"Permissions": [
{
"Operation": "/Operations/WorkItem/Search",
"User": "users/1",
"Role": null,
"Allow": true,
"Priority": 1
}
]
}
I would then expect the following code to limit a query (from Bob's perspective) to this one WorkItem, because that is all he has permission to.
using (var session = documentStore.OpenSession())
{
session.SecureFor("raven/authorization/users/1", "/Operations/WorkItem/Search");
var workItemsQuery = from wi in session.Query<WorkItem>()
select wi;
var debts = workItemsQuery.ToList();
// do something with the work items
}
I based my code on the following example from RavenDB's documentation (Context & User section): http://ravendb.net/docs/2.5/server/extending/bundles/authorization-bundle-design
What I am getting instead is WorkItems that have no explicit permissions set. This is very puzzling to me because if I run the following code:
using (var session = mDocumentStore.OpenSession())
{
var answer = session.Advanced.IsOperationAllowedOnDocument(userId, operation, securableId);
var allowed = answer.IsAllowed;
}
allowed is true.
One additional item of note, I am attempting to ignore or simply not use the authorization bundle's concept of role and I wonder if this is having some unintended effect.
It is very possible that I am misunderstanding their example, could anyone shed any light on this subject for me? Thanks in advance.
Also, I wondered if the issue I am encountering was related to this StackOverflow question: RavenDB: Raven Query not returning correct count with document authorization, but their issue seems to be with the count and not necessarily the actual results.
Just to tiddy up this question, I will provide an answer to what was causing my problem. The issue was related to the use of "raven/authorization/users/1" syntax. When I changed the search command to simply use, "users/1" it worked correctly.

How to add content and moreDetailsUrl for Google Search suggest?

I'm using GSA (version 6.14) and we would like to get an auto suggest function on our website. Works fine for basic requests, but it seems the GSA offers more functionality when you would be using user-added results. However, I can find nowhere a reference on how to add user-added results.
This is what the information tells me today :
/suggest?q=<query>&max=<num>&site=<collection>&client=<frontend>&access=p&format=rich
should return a response as below :
{
"query": "<query>",
"results": [
{ "name": "<term 1>", "type": "suggest"},
{ "name": "<term 2>", "type": "suggest"},
{ "name": "<term 3>", "type": "uar", "content": "Title of UAR",
"moreDetailsUrl": "URL of UAR"}
]
}
I am able to get results as the first 2 lines, but would like to get results as the last line also, so with content and a moreDetailsUrl. So maybe a very stupid question but I am not able to find the answer anywhere : How and where do I add this UAR ?
I actually want to understand if it's feasible to get metadata into the content part of the JSON, so if for instance an icon meta is available I'd like to have it included in the JSON so I can enrich my search results.
User Added Results are a OneBox that can be added to multiple frontends. See this: https://developers.google.com/search-appliance/documentation/614/admin_searchexp/ce_improving_search#uar
When done with Suggest, the data is fed from user entering 'keymatches' directly. What's different about them is that they are a direct link versus a suggested query. If you use the out of the box experience, you'll click a link to the url instead of running another query.