I have a problem with updating the pass expirationdate

This is my function

public function getPassFire($id){
$login = 'xxxx';
$password = 'xxxx';
$url = 'https://wallet-api.urbanairship.com/v1/pass/' . $id;
$data = array("headers" => $datapass);
$data_string = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data_string)));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_USERPWD, "$login:$password");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
$result = curl_exec($ch);
return redirect()->route('viewpass');

Everything works, pass updated date changes, does not return any error.

But when i call a getpass this is a part of response

"expirationDate":{ "changeMessage":null, "label":"", "hideEmpty":false, "formatType":"String", "value":"2017-07-20T11:26:00Z", "fieldType":"topLevel", "required":false }

Label not appears. The same thing if instead of updating the label, change the value like:


In this case the value does not change, only pass updated date changes.


One last things: With the request "list passes" i can not know which passes have expired. I have to make the call "get pass" for each passes returned, right? Wasn't It better to return the expirationdate to the "list passes" too?

Many thanks


Didn't find what you were looking for?

New post


1 comment

  • Hi Michele,

    I don't believe the API will allow you to create/update passes with an expiration date set in the past.

    Additionally, remember that the expiration date is not a field on the pass, but rather a value assigned to the pass. So, the expiration date does not actually have or need a label value, since it's not shown to the user. 

    For the list passes, yes, that is correct, you'll need to make the call to get the pass for each pass to return the expiration date.


    Comment actions Permalink

Please sign in to leave a comment.