I followed the article here to create my first Passbook pass.
{
"formatVersion" : 1,
"passTypeIdentifier" : "pass.com.mypassbook.coupon",
"serialNumber" : "E5982H-I2",
"teamIdentifier" : "ASDFGM5E66",
"barcode" : {
"message" : "123456789",
"format" : "PKBarcodeFormatPDF417",
"messageEncoding" : "iso-8859-1"
},
"locations" : [
{
"longitude" : -122.3748889,
"latitude" : 37.6189722
},
{
"longitude" : -122.03118,
"latitude" : 37.33182
}
],
"organizationName" : "Paw Planet",
"description" : "Coupon for a free lollipop at Example Candy Store",
"logoText" : "Example Candy Store",
"foregroundColor" : "rgb(255, 255, 255)",
"backgroundColor" : "rgb(206, 140, 53)",
"coupon" : {
"primaryFields" : [
{
"key" : "offer",
"label" : "On July 29",
"value" : "Free lollipop"
}
]
}
}
In the end I created the pkpass file but when I drag and drop the file on the simulator I get the following:
Any ideas? I checked the system logs in the console app and it does not display any messages.
When I email the pkpass as an attachment to myself this is what I see.
There is something wrong with the way you've signed your pass. When I open the pass on my iPhone, I get this in the logs:
Invalid data error reading pass pass.com.azamsharp.blindscoupon/123456. The passTypeIdentifier or teamIdentifier provided may not match your certificate, or the certificate trust chain could not be verified.
Double check your certificate and values match. You must also remember to include the WWDC certificate when signing the manifest.
Related
RingCentral has a type of phone number called Contact Center Routing Number (CCRN) which is used with RingCentral Office and Contact Center. Is it possible to get a list of these numbers via API?
In the Online Account Portal, these numbers are found under:
"Phone System" > "Phone Numbers" > "Contact Center".
I looked in the RingCentral API Reference but didn't see a section for Contact Center.
To add to Grokify's answer above, these are the contactCenterProvider IDs:
1 = In-Contact NA
2 = In-Contact EU
3 = In-Contact APAC
4 = In-Contact AUS
A list of Contact Center Routing Numbers (CCRNs) can be retrieved using the List Account Phone Numbers API documented here:
https://developers.ringcentral.com/api-reference/Phone-Numbers/listAccountPhoneNumbers
CCRN Phone Numbers will have usageType set to ContactCenterNumber.
When querying the API, the usageType query string parameter can be set to filter results. In the response, the same parameter is present in the phone numbers records.
The contactCenterProvider property is populated for CCRNs as shown below:
Here's an example:
GET /restapi/v1.0/account/11111111/phone-number?usageType=ContactCenterNumber&perPage=10
HTTP 200 OK
{
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/11111111/phone-number?page=1&perPage=10",
"records" : [ {
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/11111111/phone-number/22222222",
"id" : 22222222,
"phoneNumber" : "+18005550100",
"paymentType" : "TollFree",
"type" : "VoiceOnly",
"usageType" : "ContactCenterNumber",
"status" : "Normal",
"contactCenterProvider": {
"id": "1",
"name": "In-Contact NA"
}
} ]
}
It is possible to update the phone number's contactCenterProvider as shown:
PUT /restapi/v1.0/account/11111111/phone-number/22222222
{
"usageType": "ContactCenterNumber",
"contactCenterProvider": {
"id": "3"
}
}
Update Response:
{
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/11111111/phone-number/22222222",
"id" : 22222222,
"phoneNumber" : "+18005550100",
"paymentType" : "TollFree",
"type" : "VoiceOnly",
"usageType" : "ContactCenterNumber",
"status" : "Normal",
"contactCenterProvider": {
"id": "3",
"name": "In-Contact APAC"
}
}
Hi all i'm using Xcode 7 and swift2 but for some weird reason i'm unable to set an data object of type JSON, i've tried using different types and they seem to come up on the intellisense but for some reason JSON is available when it previously was..
The error i'm getting is
Use of undeclared type JSON
This is the format of my data in a blank swift file it's worth note mentioning that using the word JSON doesn't turn green like it normally should.
var data: JSON = [
"stories" : [
[
"Article_Link" : "http://www.webdesignernews.com/redirect?url=http%3A%2F%2Fwww.creativebloq.com%2Fweb-design%2Fweb-designers-take-centre-stage-new-sitcom-91516753",
"Article_Shares" : "",
"Article_Time" : "44 min ago",
"Article_Title" : "Web Designers Take Centre Stage in New Sitcom",
"icon" : "Web-Designer-Depot",
"index" : 2,
"source" : "Web Designer Depot",
"url" : "http://www.webdesignernews.com/",
],
[
"Article_Link" : "http://www.webdesignernews.com/redirect?url=http%3A%2F%2Fwww.webdesignerdepot.com%2F2015%2F09%2Fwhats-new-for-designers-september-2015%2F",
"Article_Shares" : "203",
"Article_Time" : "50 min ago",
"Article_Title" : "What's New for Designers, September 2015",
"icon" : "Web-Designer-Depot",
"index" : 3,
"source" : "Web Designer Depot",
"url" : "http://www.webdesignernews.com/",
],
[
"Article_Link" : "http://www.webdesignernews.com/redirect?url=http%3A%2F%2Fblog.atomic.io%2Fnews%2Fadvanced-motion-control-now-in-atomic%2F",
"Article_Shares" : "68",
"Article_Time" : "1 hour ago",
"Article_Title" : "New in Atomic Prototype with Advanced Motion Control + Swipe Gestures",
"icon" : "Web-Designer-Depot",
"index" : 4,
"source" : "Web Designer Depot",
"url" : "http://www.webdesignernews.com/",
]
]
]
Compiler have all rights to throw that error. There is no data type called JSON existing in Swift. You should use dictionary instead.
When using the IOS API, I'm making a call to connect via the ApigeeDataClient connectEntities method. I pass in the type "users", then the user's uuid, then connectionType "likes", with the connectee type of "songs" and the song's uuid.
Example:
ApigeeClientResponse *response = [_dataClient connectEntities:#"users" connectorID:_apigeeUser.uuid connectionType:#"likes" connecteeType:#"songs" connecteeID:song.uuid];
When I make the connection, it says successful, but when I look at the data on the server, it seems to save the connection incorrectly. For example, for the song, I see:
connecting :likes :/songs/b523a6aa-bb39-11e4-a2bb-35673af856e9/connecting/likes
It looks like the song's uuid isn't in the connecting path.
The same is true for the connection related to the user. It's the user's uuid that seems to be connected to the same user. The uuid is that of the song's uuid, not the user's. When I make the call to getEntityConnections, like so:
ApigeeClientResponse *response = [_dataClient getEntityConnections:#"songs" connectorID:_apigeeUser.uuid connectionType:#"likes" query:nil];
It returns an error, saying "expected song, but got user's uuid.
Entity c831e1c4-2e6e-11e4-94ce-299efa8c6fd5 is not the expected type, expected song, found user"
In looking in Apigee itself, in the data section, I see the following snippet:
"connections": {
"likes": "/users/c831e1c4-2e6e-11e4-94ce-299efa8c6fd5/likes"
}
The song's uuid is missing. Even when I try to update the JSON directly on the server, basically adding the song's uuid to the end, it says it's saved, but it removes the song's uuid.
Even just using the curl method to make a connection doesn't work. For example:
curl -X POST http://api.usergrid.com/peterdj/sandbox/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes/c37f1eaa-bfa3-11e4-9141-97b3510c98e6
When I make that call, I get this
{"action":"post",
"application":"0baaf590-2c1b-11e4-9bb5-11cb139f1620",
"params":{
},
"path":"/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes",
"uri":"https://api.usergrid.com/peterdj/sandbox/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes",
"entities":[
{
"uuid":"c37f1eaa-bfa3-11e4-9141-97b3510c98e6",
"type":"song",
"name":"WingSpan",
"created":1425167080842,
"modified":1425167080842,
"bpm":"124",
"code":"WingSpan",
"genre":"Progressive House",
"metadata":{
"connecting":{
"likes":"/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes/c37f1eaa-bfa3-11e4-9141-97b3510c98e6/connecting/likes"
},
"path":"/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes/c37f1eaa-bfa3-11e4-9141-97b3510c98e6"
},
"title":"Wing Span"
}
],
"timestamp":1425246006718,
"duration":78,
"organization":"peterdj",
"applicationName":"sandbox"
}
Notice that the resulting connecting path seems correct when it's returned, but when do another GET curl, as so:
curl http://api.usergrid.com/peterdj/sandbox/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d
The song's uuid isn't there:
{
"action" : "get",
"application" : "0baaf590-2c1b-11e4-9bb5-11cb139f1620",
"params" : { },
"path" : "/users",
"uri" : "https://api.usergrid.com/peterdj/sandbox/users",
"entities" : [ {
"uuid" : "bc2fc82a-bfa3-11e4-a994-b19963f1779d",
"type" : "user",
"name" : "peter",
"created" : 1425167068578,
"modified" : 1425167495412,
"username" : "peterdj",
"email" : "asdf#adf.com",
"activated" : true,
"picture" :"",
"metadata" : {
"path" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d",
"sets" : {
"rolenames" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/roles",
"permissions" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/permissions"
},
"connections" : {
"likes" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/likes"
},
"collections" : {
"activities" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/activities",
"devices" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/devices",
"feed" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/feed",
"groups" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/groups",
"roles" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/roles",
"following" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/following",
"followers" : "/users/bc2fc82a-bfa3-11e4-a994-b19963f1779d/followers"
}
}
} ],
"timestamp" : 1425311662762,
"duration" : 12,
"organization" : "peterdj",
"applicationName" : "sandbox"
}
Is this a bug with the entity connections with Apigee/Usergrid or am I doing something wrong?
Thanks
Well, turns out, thanks to the comments by #remus, I've figured it out.
In this call:
ApigeeClientResponse *response = [_dataClient getEntityConnections:#"songs" connectorID:_apigeeUser.uuid connectionType:#"likes" query:nil];
The connection needs to be "users", not "songs". Works now. Thanks #remus
I build a simple website that is a portfolio for iphone apps, the site is built in ruby on rails 4, I need to have certain apps reviews and ratings being loaded from itunes store, as in I have a URL that connetcs to an iphone app page in itunes store, I want to make sure my website always displays the latest ratings on that app.
I don't know how do accomplish that.
Have you look into https://github.com/dewski/itunes
Example Response
{
"artist_id" : 954266,
"artist_name" : "Green Day",
"artist_view_url" : "http://itunes.apple.com/us/artist/green-day/id954266?uo=4",
"artwork_url100" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.100x100-75.jpg",
"artwork_url30" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.30x30-50.jpg",
"artwork_url60" : "http://a1.phobos.apple.com/us/r1000/049/Features/1e/17/05/dj.rpihtiig.60x60-50.jpg",
"collection_censored_name" : "Dookie",
"collection_explicitness" : "explicit",
"collection_id" : 5132583,
"collection_name" : "Dookie",
"collection_price" : 9.99,
"collection_view_url" : "http://itunes.apple.com/us/album/she/id5132583?i=5132563&uo=4",
"content_advisory_rating" : null,
"country" : "USA",
"currency" : "USD",
"disc_count" : 1,
"disc_number" : 1,
"kind" : "song",
"preview_url" : "http://a1.phobos.apple.com/us/r1000/027/Music/0e/86/7a/mzm.wchstext.aac.p.m4a",
"primary_genre_name" : "Alternative",
"release_date" : "2003-04-22 07:00:00 Etc/GMT",
"track_censored_name" : "She",
"track_count" : 15,
"track_explicitness" : "notExplicit",
"track_id" : 5132563,
"track_name" : "She",
"track_number" : 8,
"track_price" : 1.29,
"track_time_millis" : 134293,
"track_view_url" : "http://itunes.apple.com/us/album/she/id5132583?i=5132563&uo=4",
"wrapper_type" : "track"
}
I am trying to run queries against the JIRA API and get results in which I can see the dates and times that each issue went through a status change.
E.g.: Run a query to grab all issues with a certain assignee and see, along with the rest of the information, timestamps for when each issue changed from "Open" to "Resolved".
Is this possible?
EDIT: I have tried expanding the changelog, but while that tells me what status changes a ticket went through (e.g., that the particular ticket transitioned from "Open" to "Resolved" and then from "Resolved" to "Closed"), it doesn't tell me WHEN these transitions occurred.
Turns out that each of the transition objects showing the status changes have a "created" field that contains the time and date the transition occurred, which I feel is a bit of a misnomer, but there it is. An example object inside the "histories" array in the expanded changelog object:
{ "author" : { "active" : true,
"avatarUrls" : { "16x16" : "https://company.jira.com/secure/useravatar?size=xsmall&avatarId=10072",
"24x24" : "https://company.jira.com/secure/useravatar?size=small&avatarId=10072",
"32x32" : "https://company.jira.com/secure/useravatar?size=medium&avatarId=10072",
"48x48" : "https://company.jira.com/secure/useravatar?avatarId=10072"
},
"displayName" : "First Last",
"emailAddress" : "first.last#company.com",
"name" : "first.last",
"self" : "https://company.jira.com/rest/api/2/user?username=first.last"
},
"created" : "2013-04-17T16:21:13.540-0400",
"id" : "24451",
"items" : [ { "field" : "status",
"fieldtype" : "jira",
"from" : "5",
"fromString" : "Resolved",
"to" : "6",
"toString" : "Closed"
},
{ "field" : "assignee",
"fieldtype" : "jira",
"from" : "old.assignee",
"fromString" : "Old Assignee",
"to" : "first.last",
"toString" : "First Last"
}
]
}