Azure Data Factory Pagination - get next page with AbsoluteURL - pagination

I am trying to get the next page from API response, I have already tried using "AbsouteURL" which seems to "work" as it tries to call that URL (I can see that in the ADF output log).
The issue seems to be the response not having correct url in the response, it just says 0.0.0.0 instead of actual URL.
example:
"meta": {
"count": 500,
"pageCount": 10,
"totalCount": 50000,
"next": "http://0.0.0.0:3000/myData/myDataId?page=2&limit=25",
"previous": null,
"self": "http://0.0.0.0:3000/myData/myDataId?page=1&limit=25",
"first": "http://0.0.0.0:3000/myData/myDataId?page=1&limit=25",
"last": "http://0.0.0.0:3000/myData/myDataId?page=400&limit=25"
},
Is is possible to replace "0.0.0.0" with actual host name i.e. 'myWebApplication' when passing using "AbsouteURL" property?

Related

WikiJS GraphQL API returning 2 different IDs for the same page

I am using the docker container flavor of WikiJS with a postgres database, out of the box. No tweaks. I am trying to get the API working and it appears that everything works functionally. However, I'm getting wrong ID values for search.
The following query:
query {
pages {
list{
id
path
title
contentType
isPublished
isPrivate
createdAt
updatedAt
}
}
}
Returns the following result:
...
{
"id": 41,
"path": "characters/nicodemus",
"title": "Nicodemus",
"contentType": "markdown",
"isPublished": true,
"isPrivate": false,
"createdAt": "2022-07-26T20:52:26.727Z",
"updatedAt": "2022-08-17T20:31:02.537Z"
},
...
But this query:
query {
pages {
search (query:"nicodemus"){
results{
id
title
path
locale
}
}
}
}
returns this result:
{
"id": "53",
"title": "Nicodemus",
"path": "characters/nicodemus",
"locale": "en"
},
The second result, which is much more efficient than just grabbing every page every time, returns the page id as 53 (incorrect), while all pages returns the page id as 41 (correct).
I am not very familiar with graphql, but I understand the basics and like I said, it seems to be working fine. I don't even know where to start debugging this issue.

BigCommerce API Webhook event payload with address created/updated is missing customer_id

From the WebHook documentation for a store/customer/address/updated/store/customer/address/created events should have following payload:
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
However, in the logs we don't see the "address" part. The payload is always coming as:
{
created_at: 1573847377
data: {
id: 2246136
type: "customer"
}
hash: "%hash%"
producer: "%producer%"
scope: "store/customer/address/updated"
store_id: "%storeid%"
}
And the payload.data.id is not the customer id, as fetching customer by given ID always results in 404.
Fetching address with given id is also impossible, as the resource url should include customer_id which is absent in the response.
Contacted BigCommerce support already, but maybe someone had solved this issue already?
Saw relevant question in the BigCommerce's community, but it was also unanswered.
I have encountered a similar problem, and believe I have isolated the conditions under which it occurs.
I am building an app with MEAN stack that uses bigcommerce API/webhooks.
When I tried to create a customer address in-app, it makes an API request to BigCommerce and creates customer addresses in BigCommerce. Via the webhooks, I have implemented the store_customer_address_created hook event.
So there are two cases when the address webhook event is being triggered:
When the customer address is created in-app and it sends an address creation request via the API to BigCommerce.
When the customer address is directly created in the BigCommerce admin.
Here are the responses from those:
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
{
"scope": "store/customer/address/created",
"store_id": "1025646",
"data": {
"type": "customer",
"id": 60,
"address": {
"customer_id": 32
}
},
"hash": "416ca9c01779515de91824aa1cac9012ee691e7a",
"created_at": 1561481620,
"producer": "stores/{store_hash}"
}
As you can see, the address field is not included when the customer address is being created by the API. I’m not sure if it is designed by the BigCommerce team, or a special case. But I think we can identify if the customer address is being created by the BigCommerce admin directly or via the API myself based on this distinction.
I believe you are encountering the first case on your end.
I hope this helps and please update me if you have any other opinions.
It is fairly strange to see this webhook response without the address field, and I haven't had any luck replicating this with scope for store/customer/address/updated. Are you working with any other code beyond this webhook or testing the webhook event specifically?

How to retrieve Work Item linked to specific commit - Azure Devops REST API

I need to be able to retrieve the linked work item of any given specific commit. I'm currently using the following api call
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}?api-version=5.0
with the following response
{
"parents": [],
"treeId": "7fa1a3523ffef51c525ea476bffff7d648b8cb3d",
"push": {
"pushedBy": {
"id": "8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"displayName": "Chuck Reinhart",
"uniqueName": "fabrikamfiber3#hotmail.com",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=8c8c7d32-6b1b-47f4-b2e9-30b477b5ab3d"
},
"pushId": 1,
"date": "2014-01-29T23:33:15.2434002Z"
},
"commitId": "be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4",
"author": {
"name": "Chuck Reinhart",
"email": "fabrikamfiber3#hotmail.com",
"date": "2014-01-29T23:32:09Z"
},
"committer": {
"name": "Chuck Reinhart",
"email": "fabrikamfiber3#hotmail.com",
"date": "2014-01-29T23:32:09Z"
},
"comment": "First cut\n",
"url": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4",
"remoteUrl": "https://dev.azure.com/fabrikam/_git/Fabrikam-Fiber-Git/commit/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4",
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4"
},
"repository": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249"
},
"changes": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4/changes"
},
"web": {
"href": "https://dev.azure.com/fabrikam/_git/Fabrikam-Fiber-Git/commit/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4"
},
"tree": {
"href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/trees/7fa1a3523ffef51c525ea476bffff7d648b8cb3d"
}
}
}
from https://learn.microsoft.com/en-us/rest/api/azure/devops/git/commits/get?view=azure-devops-rest-5.0 and am missing a way to see what work item its linked to or if it is linked at all. Does anyone know of a way to get this information? Thanks
You could use the Get Commits API, docs here. The base request looks like:
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?api-version=5.0
You could then add the following parameters:
fromCommitId - string - If provided, a lower bound for filtering commits alphabetically
toCommitId - string - If provided, an upper bound for filtering commits alphabetically
includeWorkItems - boolean - Whether to include linked work items
So that your final query would look something like, with your toCommitId and fromCommitId parameters being your commit id that you are after (the documentation doesn't specificy whether these are inclusive or exclusive so your might have to tweak this slightly):
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?includeWorkItems=true&.toCommitId={searchCriteria.toCommitId}&fromCommitId={searchCriteria.fromCommitId}&api-version=5.0
The result should contain a workItems property inside each commit object of the response as per this documentation.
Note:
Parameters that use the searchCriteria prefix in their name can be specified without it as query parameters, e.g. searchCriteria.$top -> $top
There is also:
ids - array - If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters.
Which could allow you to forgo passing in the to and from commit ids but the docs state that it May not be combined with other parameters - even though the example request does combine it with other parameters. I haven't tried this myself so please do comment when you find out whether you go with from-to id or just ids.
OPs action
The OP ended up using the following request as they didn't mind all commits being returned:
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits?includeWorkItems=true&api-version=5.0

Instagram api thumbnail_url gives 5xx Server Error

thumbnail_url link gives 5xx Server Error only for slide show posts. Works fine for Video and Image only posts.
Failing case: https://www.instagram.com/p/BvEv0AVlgGb
API Call:
https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BvEv0AVlgGb
Response:
{
"version": "1.0",
"title": "Higher. Further. Faster. Complete your #CaptainMarvel look with these Carol Danvers-approved glasses from #diffeyewear! Shop now at diffeyewear.com #ad",
"author_name": "marvel",
"author_url": "https://www.instagram.com/marvel",
"author_id": 204633036,
"media_id": "2000934416420307355_204633036",
"provider_name": "Instagram",
"provider_url": "https://www.instagram.com",
"type": "rich",
"width": 658,
"height": null,
"html": "<blockquote ......>",
"thumbnail_url": "https://scontent-sin2-2.cdninstagram.com/vp/d49a6c1ebb809f2a678807c6c668dc20/5D4E7C9B/t51.2885-15/e35/s612x612/51757368_424979878262102_7818160988900314568_n.jpg?_nc_ht=scontent-sin2-2.cdninstagram.com",
"thumbnail_width": 612,
"thumbnail_height": 611
}
This image post works fine: https://www.instagram.com/p/BvE6t9fA3BE
Why is the thumbnail url broken only for image stacks?
The best way to track this information is by adding the __a=1 param and value to the original url. This will return a GraphQL response which holds all the required information.
For the failing case posted above: https://www.instagram.com/p/BvEv0AVlgGb, simply change the url to https://www.instagram.com/p/BvEv0AVlgGb?__a=1

How to use GetChanges API for File Folder changes in MS Sharepoint 2013?

I have added some folder and files to 'Shared Documents' and trying to read get changes response.
Please have a look at my /getchanges request and response below:
POST https://xxxx.sharepoint.com/_api/web/getchanges?$filter=(Time ge datetime'2018-04-03T09:24:17Z')
{"query":{"__metadata":{"type":"SP.ChangeQuery"},"Add":true,"Web":true,"Site":true,"Update": true, "DeleteObject":true, "File":true, "Folder":true, "ContentType":true}}
For the above request I am getting below response:
{
[
"odata.type": "SP.ChangeFile",
"odata.id": "https://xxxx.sharepoint.com/_api/SP.ChangeFile7f33e785-a5dc-424a-bc31-d953171db7b2",
"odata.editLink": "SP.ChangeFile7f33e785-a5dc-424a-bc31-d953171db7b2",
"ChangeToken": {
"StringValue": "1;2;155cd6ac-2fa5-4fc6-8297-10917724fcdf;636583446482830000;79145543"
},
"ChangeType": 1,
"SiteId": "f6aea202-e4c9-4a16-927d-a222975c592e",
"Time": "2018-04-03T09:30:48Z",
"UniqueId": "83746e80-56e7-4b76-9427-6920b0677447",
"WebId": "155cd6ac-2fa5-4fc6-8297-10917724fcdf"
},
{
"odata.type": "SP.ChangeFolder",
"odata.id": "https://xxxxxx.sharepoint.com/_api/SP.ChangeFolder202b82c0-4a3a-4b70-879a-8d41b63ced7f",
"odata.editLink": "SP.ChangeFolder202b82c0-4a3a-4b70-879a-8d41b63ced7f",
"ChangeToken": {
"StringValue": "1;2;155cd6ac-2fa5-4fc6-8297-10917724fcdf;636583446489070000;79145549"
},
"ChangeType": 2,
"SiteId": "f6aea202-e4c9-4a16-927d-a222975c592e",
"Time": "2018-04-03T09:30:49Z",
"UniqueId": "6847b1e9-169b-4d15-9c3c-0b3b1a9848a8",
"WebId": "155cd6ac-2fa5-4fc6-8297-10917724fcdf"
}
]
}
I am facing below issues for getchanges api:
getchanges API not returning changes in response in case of File and Folder. It is returning file and folders updated yesterday.
Same API worked perfectly fine with List, ListItem, etc.
For above response, how can I retrieve which folder or file was added/updated, as I am getting webid and siteid in response
Please suggest?

Resources