Question

Answer

I've encountered an issue where the 'Try Me' feature isn't working for me, and it seems the Subscription Key is empty. How can I resolve this?"

After successfully logging in to the API portal, ensure you complete the API subscription process. Subscribing to an API product is vital to access the 'Try Me' feature for all CitySprint APIs. To accomplish this, kindly subscribe to the Development Product linked to the API collection you are using. You can access the products page by clicking on "Products" in the top menu of the page.

Can I use my actual user accounts in a development environment, or should I be using test accounts?"

All accounts used in the development area are shared test accounts. Using shared accounts for testing, rather than using your account number, has valid reasons, particularly when working in a development or testing environment. Here are some reasons why shared accounts are used:

  1. Environment Consistency:   Shared accounts ensure that all developers are using the same standardised test data and environment. This consistency helps in identifying and resolving issues effectively.

  2. Environment Independence:  If your account doesn't exist in the test environment or if there are discrepancies, using shared accounts ensures that testing can proceed without delays related to individual account setup or data synchronization.

  3. Reduced Risk:  Shared accounts minimize the risk of accidentally affecting or corrupting real customer or production data during the testing phase. This helps maintain data integrity and security.

  4. Sandboxing:Shared accounts can be considered as sandbox environments specifically set up for testing purposes, offering a controlled and isolated space to validate and verify application functionality.

Important!  During development, it's essential to ensure that shared accounts are handled securely so that sensitive or private data is not sent in the API calls.

I have been trying to use the 'Try It' button, but I keep getting a 403 error. What could be causing this, and how can I proceed?

A 403 error typically indicates that you are attempting to access a resource or perform an action for which you do not have the necessary permissions. In the context of API usage, it could mean that your credentials or access rights are not correctly configured or that you have not been granted access to use the relevant API.

Here are some steps to troubleshoot and resolve a 403 error when using the "Try It" button in APIM:

Check the Subscription Key at the top of the Try Me slider. If this is empty you are not logged in

Check Ocp-Apim-Subscription-Key: Ensure  Ensure that you have provided the correct Ocp-Apim-Subscription-Key. Make sure it is valid and you have not accidentally changed the value.

After being away from my machine for a while, I'm unable to use the 'Try Me' feature or access any other APIs. What steps should I take to regain access?"

It seems that you're unable to use the "Try Me" feature or access other APIs because your session has timed out in the background while you were away from your machine. To resolve this issue, you can try the following steps:

  1. Refresh the Page: : Simply refreshing the page in your browser may re-establish your session and allow you to use the "Try Me" feature and access other APIs.

  2. Log In Again: : If refreshing the page doesn't work, you may need to log in again to the API Management portal. Look for a "Log In" or "Sign In" option and provide your credentials to reauthenticate.

  3. Clear Browser Cache: Sometimes, cached data can cause issues with session management. Clearing your browser's cache and cookies can help resolve such issues.

If the problem continues please send an email to apiteam@citysprint.co.uk

Why do the booking APIs use an idempotency Key?

An idempotency key is utilised to ensure the idempotent behaviour of API requests. Idempotence means that if the same request is sent multiple times, it will have the same effect as sending it just once. In the context of APIs, having an idempotency key serves several important purposes:

  1. Preventing Duplicate Operations:  It helps prevent accidental duplication of requests. If, for example, a network issue causes a client to believe that a request failed and it resubmits the same request, the server can recognize the idempotency key and realize that it has already processed that request.

  2. Enhancing Reliability: Idempotency  Idempotency keys enhance the reliability and robustness of API interactions. They ensure that even if there are issues in the communication between the client and server, the outcome of the operation remains consistent.

  3. Simplifying Error Handling: When an  When an API request fails, the client can retry it with the same idempotency key without worrying about causing duplicate actions or unintended consequences.

In summary, an idempotency key is a valuable tool in ensuring the reliability, consistency, and safety of API operations, especially in scenarios where requests may be retried or where network issues can lead to uncertainty about whether a request was processed or not.

What time format is utilised in the APIs? I'd like to ensure my data is formatted correctly when interacting with your services."

The times used in the APIs are in Coordinated Universal Time (UTC). This standardised time system is commonly used in APIs and other computer-related contexts because it provides a consistent and unambiguous reference point for time, making it easier to coordinate activities across different time zones and systems.

Why do error messages sometimes not use the correct field name?

The error messages may not always reflect the correct field name due to an ongoing improvement process. We are actively working on enhancing our error handling system to ensure accurate and informative messages.

While the error messages may not be perfect, the functionality of the system remains intact. Users can continue using the system, and any issues related to incorrect field names in error messages will be addressed in subsequent updates.

Is it possible to make amendments to a booking once it's been submitted through the APIs? If so, what's the process for making changes?"

This API will be coming at a later date. However, it's important to understand the guidelines for making changes to a booking for Development SameDay or Production SameDay services. Based on the information provided, here's how you can make amendments:

  1. Amendable Details (e.g., references or contact details):

    • You can update information such as references or contact details without cancelling the booking.

    • You can make the necessary changes directly to the existing booking to ensure that the correct information is used.

  2. Non-Amendable Details (e.g., addresses or times):

    • If you need to change critical information like delivery addresses or times, you should follow these steps:

      • a. first, Cancel the existing booking.

      • b. After cancelling, create a new booking with the updated information.

    • o The reason for cancelling and rebooking in this case is that changes to addresses or times can impact delivery and collection times, as well as pricing. This process ensures that key information is state is captured correctly and correct pricing is provided.

By adhering to these procedures, you can make necessary adjustments to your bookings while ensuring that all relevant information, including delivery and collection times and prices, remains accurate and up to date.

Is it possible to create a scheduled job to run at a specific time each day or week?

As of now, you cannot create a scheduled job for a specific time each day or week through the APIs yet.

To set this up today you will need to contact your account manager or the CitySprint Contact Centre. They can assist you in setting up a scheduled job according to your specific requirements. Once created, the scheduled job will operate in accordance with the specified schedule until it reaches an expiry date or is cancelled, depending on your preferences.

CitySprint may consider providing this feature in the future if there is sufficient demand for it, but as of today, it's not available.

I have multiple accounts, and I need to test using different accounts during the development process. What's the recommended approach for achieving this?

There are 4 different accounts available for testing during development, these are:

  • APIM1

  • APIM2

  • APIM3

  • APIM4

These accounts are specifically designated for development purposes. When transitioning to production usage, the QA team will collaborate with you to configure your accounts, enabling you to utilise the production APIs.

I've implemented the Python example code provided by APIM, but unfortunately, it's not functioning as expected.

In the context of Python, there have been reports suggesting the necessity of including an additional User-Agent header.

Even after retrieving a canceled booking, the status continues to display as "Booked."

Efforts are underway to address this issue, and a forthcoming version will include an update to display the status as "Cancelled."

The signature is returned as an encoded string, how can I convert it into an actual signature?

The signature is a bitmap encoded in base64. To use it, you must decode it and save it as a bitmap file. Below are examples for both macOS and Windows PowerShell.

Mac:

pbpaste "signature_base64_string_here" | base64 -D -i - > /tmp/bitmap.bmp && open /tmp/bitmap.bmp

Windows PowerShell:

$base64String = "signature_base64_string_here"
[byte[]]$bytes = [System.Convert]::FromBase64String($base64String)
Set-Content -Path "C:\path\to\output\image.bmp" -Value $bytes -Encoding Byte

Can you tell me what the sequence of the status updates is?

For a diagram showing the status updates visit: Status updates