Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ssl param mapi #41

Merged
merged 2 commits into from
Mar 4, 2022
Merged

Feature/ssl param mapi #41

merged 2 commits into from
Mar 4, 2022

Conversation

christianzoppi
Copy link
Contributor

This PR adds the SSL parameter to the constructor of the MAPI and it fixes an error caused by the inconsistency of the args of the responseHandler function of the MAPI with the one declared in the parent class. This solves #40 and #39.

How to test it

Since we don't have any test in place for the MAPI, you can manually test this in a standalone PHP script. You can create a new space for testing and use one of the examples from the MAPI:

$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$spaceId = 'SPACE_ID'; // The space id
$storyId = 'STORY_ID'; // The id of the Home story created by default in the test space
$payload = [
  "story" =>  [
    "name" =>  "Story Name",
    "slug" =>  "story-name",
    "id" =>  $storyId ,
    "content" =>  [
      "component" =>  "page",
      "body" =>  []
    ]
  ],
  "force_update" =>  1,
  "publish" =>  1
];

echo $client->put("spaces/{$spaceId}/stories/{$storyId}", $payload)->getCode();

If the code is 200 and the story has now the new name and slug assigned via API, it's ok.

Copy link

@thiagosaife thiagosaife left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the test as suggested and it seems to be working properly.

@christianzoppi
Copy link
Contributor Author

Thanks, @thiagosaife! 🙏🏻

@christianzoppi christianzoppi merged commit f0594fb into master Mar 4, 2022
@joaokamun joaokamun deleted the feature/ssl-param-mapi branch April 19, 2022 11:03
@joaokamun joaokamun restored the feature/ssl-param-mapi branch April 19, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants